Skip to content
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

Merged
merged 1 commit into from Aug 20, 2016
Merged

Conversation

sophiajt
Copy link
Contributor

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
   |          ^^^^

@rust-highfive
Copy link
Collaborator

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"))
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@Aatch
Copy link
Contributor

Aatch commented Aug 20, 2016

@bors r+ retry

@bors
Copy link
Contributor

bors commented Aug 20, 2016

📌 Commit 54d0acd has been approved by Aatch

@sophiajt
Copy link
Contributor Author

@bors rollup

sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 20, 2016
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
   |          ^^^^
```
bors added a commit that referenced this pull request Aug 20, 2016
@bors bors merged commit 54d0acd into rust-lang:master Aug 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants