minor refactorings around InferCtxt::enter#49020
minor refactorings around InferCtxt::enter#49020nikomatsakis wants to merge 5 commits intorust-lang:masterfrom
InferCtxt::enter#49020Conversation
|
☔ The latest upstream changes (presumably #47630) made this pull request unmergeable. Please resolve the merge conflicts. |
8432c77 to
84252f6
Compare
| /// share the inherited fields. | ||
| pub struct Inherited<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { | ||
| infcx: InferCtxt<'a, 'gcx, 'tcx>, | ||
| infcx: &'a InferCtxt<'a, 'gcx, 'tcx>, |
| pub fn enter<F, R>(&'tcx mut self, f: F) -> R | ||
| where F: for<'b> FnOnce(InferCtxt<'b, 'gcx, 'tcx>) -> R | ||
| { | ||
| pub fn enter<'tcx, R>(&'tcx mut self, f: impl FnOnce(&InferCtxt<'_, 'gcx, 'tcx>) -> R) -> R { |
There was a problem hiding this comment.
I can revert that part if you like -- I was actually working towards a goal with this patch series that didn't work out, so it's not really important either way (I just figured I'd land some of the incidental changes).
That said, I always get annoyed that enter gives me ownership of an InferCtxt, when almost everything wants a reference. I'd be quite surprised if the indrection around Inherited cost performance.
|
r=me with travis failure fixed |
|
☔ The latest upstream changes (presumably #49264) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Sigh. I should really rebase this. |
|
Ping from triage, @nikomatsakis ! We agree you should rebase this ❤️. Might as well respond to the review feedback you got while you are at it! |
|
Eh. I don't care enough to rebase this. =) |
Just a few small simplifications.
r? @eddyb