@@ -1318,7 +1318,6 @@ pub struct SourceFileDiffs {
1318
1318
}
1319
1319
1320
1320
/// A single source in the [`SourceMap`].
1321
- #[ derive( Clone ) ]
1322
1321
pub struct SourceFile {
1323
1322
/// The name of the file that the source came from. Source that doesn't
1324
1323
/// originate from files has names between angle brackets by convention
@@ -1349,6 +1348,25 @@ pub struct SourceFile {
1349
1348
pub cnum : CrateNum ,
1350
1349
}
1351
1350
1351
+ impl Clone for SourceFile {
1352
+ fn clone ( & self ) -> Self {
1353
+ Self {
1354
+ name : self . name . clone ( ) ,
1355
+ src : self . src . clone ( ) ,
1356
+ src_hash : self . src_hash . clone ( ) ,
1357
+ external_src : Lock :: new ( self . external_src . borrow ( ) . clone ( ) ) ,
1358
+ start_pos : self . start_pos . clone ( ) ,
1359
+ end_pos : self . end_pos . clone ( ) ,
1360
+ lines : Lock :: new ( self . lines . borrow ( ) . clone ( ) ) ,
1361
+ multibyte_chars : self . multibyte_chars . clone ( ) ,
1362
+ non_narrow_chars : self . non_narrow_chars . clone ( ) ,
1363
+ normalized_pos : self . normalized_pos . clone ( ) ,
1364
+ name_hash : self . name_hash . clone ( ) ,
1365
+ cnum : self . cnum . clone ( ) ,
1366
+ }
1367
+ }
1368
+ }
1369
+
1352
1370
impl < S : Encoder > Encodable < S > for SourceFile {
1353
1371
fn encode ( & self , s : & mut S ) {
1354
1372
self . name . encode ( s) ;
0 commit comments