Skip to content

Commit

Permalink
Rollup merge of #86103 - camsteffen:lifetime-hack, r=jackh726
Browse files Browse the repository at this point in the history
Remove lifetime hack

It compiles without the hack. But I don't know why. I can't get the example in the referenced issue to compile...
  • Loading branch information
JohnTitor authored Jun 8, 2021
2 parents a416e05 + fb92c92 commit b7fadfd
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions compiler/rustc_resolve/src/late/lifetimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1841,14 +1841,6 @@ fn object_lifetime_defaults_for_item(
}

impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
// FIXME(#37666) this works around a limitation in the region inferencer
fn hack<F>(&mut self, f: F)
where
F: for<'b> FnOnce(&mut LifetimeContext<'b, 'tcx>),
{
f(self)
}

fn with<F>(&mut self, wrap_scope: Scope<'_>, f: F)
where
F: for<'b> FnOnce(ScopeRef<'_>, &mut LifetimeContext<'b, 'tcx>),
Expand Down Expand Up @@ -2252,7 +2244,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
};
self.with(scope, move |old_scope, this| {
this.check_lifetime_params(old_scope, &generics.params);
this.hack(walk); // FIXME(#37666) workaround in place of `walk(this)`
walk(this);
});
}

Expand Down

0 comments on commit b7fadfd

Please sign in to comment.