@@ -387,8 +387,9 @@ pub struct TypeckTables<'tcx> {
387
387
cast_kinds : ItemLocalMap < ty:: cast:: CastKind > ,
388
388
389
389
/// Set of trait imports actually used in the method resolution.
390
- /// This is used for warning unused imports.
391
- pub used_trait_imports : Rc < RefCell < DefIdSet > > ,
390
+ /// This is used for warning unused imports. During type
391
+ /// checking, this field should not be cloned.
392
+ pub used_trait_imports : Rc < DefIdSet > ,
392
393
393
394
/// If any errors occurred while type-checking this body,
394
395
/// this field will be set to `true`.
@@ -418,7 +419,7 @@ impl<'tcx> TypeckTables<'tcx> {
418
419
liberated_fn_sigs : ItemLocalMap ( ) ,
419
420
fru_field_types : ItemLocalMap ( ) ,
420
421
cast_kinds : ItemLocalMap ( ) ,
421
- used_trait_imports : Rc :: new ( RefCell :: new ( DefIdSet ( ) ) ) ,
422
+ used_trait_imports : Rc :: new ( DefIdSet ( ) ) ,
422
423
tainted_by_errors : false ,
423
424
free_region_map : FreeRegionMap :: new ( ) ,
424
425
}
@@ -782,7 +783,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for TypeckTables<'gcx> {
782
783
cast_kinds. hash_stable ( hcx, hasher) ;
783
784
generator_sigs. hash_stable ( hcx, hasher) ;
784
785
generator_interiors. hash_stable ( hcx, hasher) ;
785
- used_trait_imports. borrow_mut ( ) . hash_stable ( hcx, hasher) ;
786
+ used_trait_imports. hash_stable ( hcx, hasher) ;
786
787
tainted_by_errors. hash_stable ( hcx, hasher) ;
787
788
free_region_map. hash_stable ( hcx, hasher) ;
788
789
} )
0 commit comments