-
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
Wording fixes in error messages #35839
Conversation
r? @Aatch (rust_highfive has picked a reviewer for you, use r? to override) |
@@ -29,7 +29,7 @@ use rustc::hir; | |||
pub fn check_legal_trait_for_method_call(ccx: &CrateCtxt, span: Span, trait_id: DefId) { | |||
if ccx.tcx.lang_items.drop_trait() == Some(trait_id) { | |||
struct_span_err!(ccx.tcx.sess, span, E0040, "explicit use of destructor method") | |||
.span_label(span, &format!("call to destructor method")) | |||
.span_label(span, &format!("explicit destructor calls not allowed")) |
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.
Not sure about this one, other labels seem to be elaborating on the original error message, whereas this one is just rephrasing it.
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.
That's true sometimes. We don't yet have the rules set in stone, rather more of a best effort.
With some errors, like this one, we use a rephrasing. Mostly this is because we're not sure where people will look first: the title or the label.
@bors r+ retry |
📌 Commit 54d0acd has been approved by |
@bors rollup |
Wording fixes in error messages This PR is largely wording fixes to existing PRs that I found going back through the ones that have already been updated. Sometimes seeing the message in context made me think "oh there's a better wording!" There's one additional fix. This will also prevent the secondary underlining of derive call (since they look like macros to the system in the way I was using): ``` error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor --> src/test/compile-fail/E0184.rs:11:10 | 11 | #[derive(Copy)] //~ ERROR E0184 | ^^^^ | | | in this macro invocation ``` Is now just: ``` error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor --> src/test/compile-fail/E0184.rs:11:10 | 11 | #[derive(Copy)] //~ ERROR E0184 | ^^^^ ```
This PR is largely wording fixes to existing PRs that I found going back through the ones that have already been updated. Sometimes seeing the message in context made me think "oh there's a better wording!"
There's one additional fix. This will also prevent the secondary underlining of derive call (since they look like macros to the system in the way I was using):
Is now just: