Skip to content

Commit

Permalink
make Inherited builder give by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Mar 14, 2018
1 parent d7c2bfe commit 8432c77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,10 @@ impl<'a, 'gcx, 'tcx> Inherited<'a, 'gcx, 'tcx> {
impl<'a, 'gcx> InheritedBuilder<'a, 'gcx> {
fn enter<'tcx, R>(
&'tcx mut self,
f: impl FnOnce(Inherited<'_, 'gcx, 'tcx>) -> R,
f: impl FnOnce(&Inherited<'_, 'gcx, 'tcx>) -> R,
) -> R {
let def_id = self.def_id;
self.infcx.enter(|infcx| f(Inherited::new(infcx, def_id)))
self.infcx.enter(|infcx| f(&Inherited::new(infcx, def_id)))
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl<'a, 'gcx> CheckWfFcxBuilder<'a, 'gcx> {
let span = self.span;
let param_env = self.param_env;
self.inherited.enter(|inh| {
let fcx = FnCtxt::new(&inh, param_env, id);
let fcx = FnCtxt::new(inh, param_env, id);
let wf_tys = f(&fcx, &mut CheckTypeWellFormedVisitor {
tcx: fcx.tcx.global_tcx(),
code,
Expand Down

0 comments on commit 8432c77

Please sign in to comment.