-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustc: Improve error messages for resolve failures. #14086
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
Conversation
Very nice. I'd prefer to replace |
@kud1ing If we can achieve consensus on this, sure, otherwise I'd prefer to leave that for a future PR, the current string is consistent with how rustc already behaves. |
This looks pretty awesome, nice work! The primary thing which needs to get done here is to remove the usage of unsafe pointers. Other than that, just some minor cleanups here and there, and otherwise I think this is good to go! |
@alexcrichton Check latest commit, I'll squash the commits if those changes are OK for you. |
Looks good to me, with a rebase I think this is good to go. |
Erm, squash, not rebase. |
@alexcrichton Done. |
…ichton Provides better help for the resolve failures inside an `impl` if the name matches: - a field on the self type - a method on the self type - a method on the current trait ref (in a trait impl) Not handling trait method suggestions if in a regular `impl` (as you can see on line 69 of the test), I believe it is possible though. Also, provides a better message when `self` fails to resolve due to being a static method. It's using some unsafe pointers to skip copying the larger structures (which are only used in error conditions); it's likely possible to get it working with lifetimes (all the useful refs should outlive the visitor calls) but I haven't really figured that out for this case. (can switch to copying code if wanted) Closes #2356.
This is fantastic. Thank you. |
`manual_flatten` should respect MSRV. changelog: [`manual_flatten`]: add MSRV check
Provides better help for the resolve failures inside an
impl
if the name matches:Not handling trait method suggestions if in a regular
impl
(as you can see on line 69 of the test), I believe it is possible though.Also, provides a better message when
self
fails to resolve due to being a static method.It's using some unsafe pointers to skip copying the larger structures (which are only used in error conditions); it's likely possible to get it working with lifetimes (all the useful refs should outlive the visitor calls) but I haven't really figured that out for this case. (can switch to copying code if wanted)
Closes #2356.