-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Improve E0617
to Distinguish Between Fn Item and Fn Pointer in FFI
#120197
Improve E0617
to Distinguish Between Fn Item and Fn Pointer in FFI
#120197
Conversation
r? @cjgillot (rustbot has picked a reviewer for you, use r? to override) |
E0617
to Distinguish Between Fn Item and Fn Pointer in FFIE0617
to Distinguish Between Fn Item and Fn Pointer in FFI
See #99927 for another atttempt to distinguish FnDef types in pretty printing. |
r? @estebank |
☔ The latest upstream changes (presumably #119972) made this pull request unmergeable. Please resolve the merge conflicts. |
compiler/rustc_hir_analysis/src/structured_errors/missing_cast_for_variadic_arg.rs
Outdated
Show resolved
Hide resolved
e4a6aa3
to
54d8f92
Compare
This comment has been minimized.
This comment has been minimized.
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.
You'll have to rebless the tests. After fixing that, could you squash all of your commits into a single one?
tidy fix compiler error fix compiler error round 2 tweak fndef pretty print fmt shorten the pretty-print output add a ui test specifically for linked issue 69232 Implement suggestion Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com> fix compiler errors rebless tests
3e36dc2
to
fe5d397
Compare
All done. |
The job Click to see the possible cause of the failure (guessed by this bot)
|
☔ The latest upstream changes (presumably #120862) made this pull request unmergeable. Please resolve the merge conflicts. |
Switching to waiting on author to rebase. Then I think we should be set here, right? Feel free to request a review with @rustbot author |
Hey, just a heads up - currently going through exams and I wouldn't be available until the end of April. (Given that there are also some MIR tests that I have to fix, it'd be great if someone else could pick this up from here) |
@HTGAzureX1212 Any updates on this? Thanks |
Given that I have no idea on fixing the MIR tests completely, it’d be great to have someone take over this PR (and that I have little time to work on things now). |
@HTGAzureX1212 @rustbot label: +S-inactive |
This Pull Requests aims to improve the diagnostics emitted in the error E0617 when making with the difference between
fn
types andfn
pointers more obvious.This involves changing the way how
ty::FnDef
is pretty-printed. This implementation specifically proposes to change it to be printed in this way:Rendered diagnostic:
This also causes all diagnostic messages that utilize the pretty-printing of
ty::FnDef
to use this implementation.Tests in
tests/ui
are currently left untouched before a consensus can be reached over how thety::FnDef
pretty-print should be modified for diagnostics.Supersedes #94637. Possible resolution of #69232.
Edit 1: I made the output a bit shorter.
Edit 2: Added example diagnostic.