-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solve ICE of issue #85350 by avoiding the case with ty::Error #85477
Conversation
r? @varkor (rust-highfive has picked a reviewer for you, use r? to override) |
r? @jackh726 |
This comment has been minimized.
This comment has been minimized.
I just want to check something, maybe there is a better way to fix it. Anyway I will need to move the test for the CI to pass. |
fa58118
to
42f7764
Compare
Hmm. So this might be one way to solve this. What I was sort of expecting was something around when we resolve the function elision (because we follow function elision rules in FnMut(&Context)) we just add that anonymous region to the impl lifetimes. But that doesn't make sense now that I think about it, because impl lifetimes are early bound and function lifetimes are late bound |
Ah but I guess its treating that FnMut as a trait object. So we could add the lifetimes to that. |
Interestingly, adding a |
Ok thanks 😃 |
After a bit of digging I think E0229 is erroneously emitted
Where as impl FnMut(&dyn Context) for 'tcx {
fn print () -> Self::Output{ }
} does not emit this error code ( and does not ICE)
An associated type binding was done outside of the type parameter declaration Erroneous code example:
To solve this error, please move the type bindings in the type parameter
Or in the
|
Interestingly impl FnMut(&'tcx Context) for 'tcx {
fn print () -> Self::Output{ }
} does not ICE and emits E0229 so maybe it is something else |
This really is a "it's really not clear what we should be doing because the syntax is quite wrong" situation. So it's hard to figure out what the user intended. So, a few options:
|
I am a bit stuck. I am do not find where the lowering precisely happens for FnMut implementation precisely or where the bound region are added for elided lifetime. I do not really see how to do 3 or 4 yet. |
@ABouttefeux let me think about this and try to write some notes this weekend |
@jackh726 any updates ? Take the time you need 😄 . Lately I did not had a lot of time anyway. |
I haven't been able to get to this :/ |
@ABouttefeux this is honestly kind of an edge case; I'm okay with just landing this as-is, |
That being said...the test location isn't correct. And I'm not quite sure the best place for it. Maybe just under @bors delegate+ just |
✌️ @ABouttefeux can now approve this pull request |
📌 Commit 42f7764 has been approved by `jackh726`` |
@bors r- looks like bors picked that up... |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #93938) made this pull request unmergeable. Please resolve the merge conflicts. |
I'm going to go ahead and close this as inactive. |
fix #85350
avoids looking for bounds in the case of supertrait on
ty::Error