-
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
Make E0599's label more clear for field which is used like a method. #127193
Conversation
r? @nnethercote rustbot has assigned @nnethercote. Use |
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.
I think rewording "field, not method" to be a bit more detailed is useful (though I think the "in scope" part is redundant imo), but this doesn't fix the issue linked, which is expressing confusion about why something is being called a field when it's a method -- just because it's a method that's out of scope.
additionally, the most confusing part of issue is the help messages getting interleaved, which is completely unaddressed. |
Thanks for the additional explanation. |
the three help messages that get printed appear in this order:
1 and 3 deal with the fact that you could fix the error by importing a trait, while 2 deals with the fact you could fix the error by turning a method call into a field access. the similar fixes should be grouped together. |
Thank you for your reply. I will take some time to process it as soon as possible |
@rustbot author |
The original help message "items from traits can only be used if the trait is implemented and in scope" may not be displayed in the order of the code due to the diagnostic's mechanism, so here I try to use |
This comment has been minimized.
This comment has been minimized.
@@ -3680,7 +3687,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |||
_ => None, | |||
}; | |||
if !trait_missing_method { | |||
err.help(if param_type.is_some() { | |||
err.span_help(span, if param_type.is_some() { |
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.
Please revert this. I don't think this improves the quality of the error message.
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.
Please revert this. I don't think this improves the quality of the error message.
Done. Thank you.
☔ The latest upstream changes (presumably #128786) made this pull request unmergeable. Please resolve the merge conflicts. |
fixes #127178