-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
librustc: hint close matches on accessing nonexisting fields #21187
librustc: hint close matches on accessing nonexisting fields #21187
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
59241c8
to
9cd90f7
Compare
@@ -3572,11 +3573,44 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>, | |||
actual) | |||
}, | |||
expr_t, None); | |||
if let Some(t) = ty::ty_to_def_id(expr_t) { | |||
suggest_field_names(t, field, tcx, vec![]); | |||
} |
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.
Could you add a test for this error message as well?
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.
sure, allthough the test is not (yet) useful since it's ignored: #21195
9f085cc
to
c8d68a7
Compare
rebased on master, added test and changed number of help messages to one. local make check-stage1 passes, make check is running right now |
make check passed |
Thanks! Could you squash the commits together as well? |
c8d68a7
to
b24da87
Compare
i just left them there for easier reading. |
@bors: r+ b24da87 |
⌛ Testing commit b24da87 with merge b63cc5c... |
💔 Test failed - auto-mac-64-opt |
b24da87
to
09d9924
Compare
sorry about that. fixed, rebased and make check ran through |
@bors: r+ 09d9924 |
…excrichton rebase and fix of #19267
⌛ Testing commit 09d9924 with merge b7930d9... |
rebase and fix of #19267