@@ -387,8 +387,9 @@ pub struct TypeckTables<'tcx> {
387387 cast_kinds : ItemLocalMap < ty:: cast:: CastKind > ,
388388
389389 /// 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 > ,
392393
393394 /// If any errors occurred while type-checking this body,
394395 /// this field will be set to `true`.
@@ -418,7 +419,7 @@ impl<'tcx> TypeckTables<'tcx> {
418419 liberated_fn_sigs : ItemLocalMap ( ) ,
419420 fru_field_types : ItemLocalMap ( ) ,
420421 cast_kinds : ItemLocalMap ( ) ,
421- used_trait_imports : Rc :: new ( RefCell :: new ( DefIdSet ( ) ) ) ,
422+ used_trait_imports : Rc :: new ( DefIdSet ( ) ) ,
422423 tainted_by_errors : false ,
423424 free_region_map : FreeRegionMap :: new ( ) ,
424425 }
@@ -782,7 +783,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for TypeckTables<'gcx> {
782783 cast_kinds. hash_stable ( hcx, hasher) ;
783784 generator_sigs. hash_stable ( hcx, hasher) ;
784785 generator_interiors. hash_stable ( hcx, hasher) ;
785- used_trait_imports. borrow_mut ( ) . hash_stable ( hcx, hasher) ;
786+ used_trait_imports. hash_stable ( hcx, hasher) ;
786787 tainted_by_errors. hash_stable ( hcx, hasher) ;
787788 free_region_map. hash_stable ( hcx, hasher) ;
788789 } )
0 commit comments