Skip to content

Commit 6f30ce0

Browse files
committed
Misc code review changes
1 parent 24b4dfc commit 6f30ce0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/librustc/ty/context.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ pub struct TypeckTables<'tcx> {
388388

389389
/// Set of trait imports actually used in the method resolution.
390390
/// This is used for warning unused imports. During type
391-
/// checking, this field should not be cloned.
391+
/// checking, this `Rc` should not be cloned: it must have a ref-count
392+
/// of 1 so that we can insert things into the set mutably.
392393
pub used_trait_imports: Rc<DefIdSet>,
393394

394395
/// If any errors occurred while type-checking this body,

src/librustc_typeck/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ fn has_typeck_tables<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
850850
fn used_trait_imports<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
851851
def_id: DefId)
852852
-> Rc<DefIdSet> {
853-
Rc::clone(&tcx.typeck_tables_of(def_id).used_trait_imports)
853+
tcx.typeck_tables_of(def_id).used_trait_imports.clone()
854854
}
855855

856856
fn typeck_tables_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,

0 commit comments

Comments
 (0)