Skip to content

Commit

Permalink
Misc code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cjkenn committed Oct 20, 2017
1 parent 24b4dfc commit 6f30ce0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/librustc/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ pub struct TypeckTables<'tcx> {

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

/// If any errors occurred while type-checking this body,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ fn has_typeck_tables<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
fn used_trait_imports<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
def_id: DefId)
-> Rc<DefIdSet> {
Rc::clone(&tcx.typeck_tables_of(def_id).used_trait_imports)
tcx.typeck_tables_of(def_id).used_trait_imports.clone()
}

fn typeck_tables_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
Expand Down

0 comments on commit 6f30ce0

Please sign in to comment.