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

[beta] Give a better error message for unknown derive messages #39444

Merged
merged 4 commits into from
Feb 6, 2017

Conversation

keeperofdakeys
Copy link
Contributor

@keeperofdakeys keeperofdakeys commented Feb 1, 2017

This PR improves the error message for unknown derive macros.

Currently unknown derives give the following error, which is very misleading:

`#[derive]` for custom traits is not stable enough for use. It is deprecated and will be removed in v1.15 (see issue #29644)

I'm currently working on a PR that will change this (#39442) to the following:

cannot find derive macro `Foo` in this scope

This PR backports the (as yet unmerged) error message to beta/1.16 (it's a pity that this is probably too late for 1.15).

r? @jseyfried

@rust-highfive
Copy link
Collaborator

warning Warning warning

  • Pull requests are usually filed against the master branch for this repo, but this one is against beta. Please double check that you specified the right target!

@jseyfried jseyfried assigned jseyfried and unassigned nikomatsakis Feb 1, 2017
@jseyfried jseyfried added beta-nominated Nominated for backporting to the compiler in the beta channel. A-diagnostics Area: Messages for errors, warnings, and lints A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 1, 2017
@alexcrichton
Copy link
Member

As a note to reviewers on this PR, we're not able to use @bors to approve branches going to beta, and it's in fact highly recommended to do so!

(just to avoid hitting the merge button)

@nikomatsakis
Copy link
Contributor

@alexcrichton

You wrote (emphasis mine):

As a note to reviewers on this PR, we're not able to use @bors to approve branches going to beta, and it's in fact highly recommended to do so!

Did you mean: "we're NOW able"?

@alexcrichton
Copy link
Member

Ooops, yes! To clarify

@bors should be used to approve this PR

To be fair the "t" and "w" keys are ... not at all close to each other.

@nikomatsakis
Copy link
Contributor

I'm a bit confused, what is this a backport of? And which beta does it have to land in?

@keeperofdakeys
Copy link
Contributor Author

On 1.15, the code #[derive(Foo)] struct A; with an unrecognised derive macro Foo gets the error message '#[derive]' for custom traits is not stable enough for use. It is deprecated and will be removed in v1.15 (see issue #29644). As part of PR #39442 the error message was updated. I intended this PR to update the error message to match that PR for the 1.16 beta/stable release.

@keeperofdakeys keeperofdakeys changed the title Give a better error message for unknown derive messages (backport to beta) Give a better error message for unknown derive messages Feb 2, 2017
@jseyfried
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 2, 2017

📌 Commit c3f9075 has been approved by jseyfried

@jseyfried jseyfried added beta-accepted Accepted for backporting to the compiler in the beta channel. and removed beta-nominated Nominated for backporting to the compiler in the beta channel. labels Feb 2, 2017
@alexcrichton alexcrichton changed the title Give a better error message for unknown derive messages [beta] Give a better error message for unknown derive messages Feb 4, 2017
@alexcrichton
Copy link
Member

@bors: p=1

(PR against beta branch)

@bors
Copy link
Contributor

bors commented Feb 4, 2017

⌛ Testing commit c3f9075 with merge 8fc0085...

@bors
Copy link
Contributor

bors commented Feb 5, 2017

💔 Test failed - status-travis

@alexcrichton
Copy link
Member

This'll need to hold off on using @bors to merge until #39546 lands unfortunately :(

@brson
Copy link
Contributor

brson commented Feb 5, 2017

It might be prudent to wait still for patches to land on master before letting bors try to land them on beta, in case there are problems with the patch.

@alexcrichton
Copy link
Member

@bors r=jseyfried

@bors
Copy link
Contributor

bors commented Feb 6, 2017

📌 Commit 6519e8b has been approved by jseyfried

@bors
Copy link
Contributor

bors commented Feb 6, 2017

⌛ Testing commit 6519e8b with merge 762a037...

bors added a commit that referenced this pull request Feb 6, 2017
[beta] Give a better error message for unknown derive messages

This PR improves the error message for unknown derive macros.

Currently unknown derives give the following error, which is very misleading:
```
`#[derive]` for custom traits is not stable enough for use. It is deprecated and will be removed in v1.15 (see issue #29644)
```

I'm currently working on a PR that will change this (#39442) to the following:
```
cannot find derive macro `Foo` in this scope
```

This PR backports the (as yet unmerged) error message to beta/1.16 (it's a pity that this is probably too late for 1.15).

r? @jseyfried
@bors
Copy link
Contributor

bors commented Feb 6, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: jseyfried
Pushing 762a037 to beta...

@bors bors merged commit 6519e8b into rust-lang:beta Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) beta-accepted Accepted for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants