-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
[WIP] Diagnose elision failure on the AST #96575
Conversation
The extra diagnostics come from the compiler no longer aborting before typeck.
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
visit::walk_ty(self, ty) | ||
} | ||
TyKind::ImplTrait(..) => { | ||
if let AnonymousLifetimeRib::PassThrough(_) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be corrected to a test on universal/existential impl-trait.
☔ The latest upstream changes (presumably #95776) made this pull request unmergeable. Please resolve the merge conflicts. |
Turns out this is not fully cooked yet. |
Based on #95776 and #96559.
This PR moves the elision failure diagnostics ("expected named lifetime") from HIR to the AST.
This is is done by introducing a pair of functions
resolve_fn_like_elision
which handles ribs for functions andelision_lifetime
which resolve parameters and return the proper lifetime for elision.I am not very confident in the elision logic: the currently implemented code allows a few more cases than is specified in the documentation. For instance, this is allowed:
This PR is WIP since its handling of impl-trait is a bit ad-hoc until #96529 is resolved.