Skip to content

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

Merged
bors merged 4 commits into
rust-lang:betafrom
keeperofdakeys:derive-error
Feb 6, 2017
Merged

[beta] Give a better error message for unknown derive messages#39444
bors merged 4 commits into
rust-lang:betafrom
keeperofdakeys:derive-error

Conversation

@keeperofdakeys

@keeperofdakeys keeperofdakeys commented Feb 1, 2017

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

@keeperofdakeys

Copy link
Copy Markdown
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
Copy Markdown
Contributor

@bors r+

@bors

bors commented Feb 2, 2017

Copy link
Copy Markdown
Collaborator

📌 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
Copy Markdown
Member

@bors: p=1

(PR against beta branch)

@bors

bors commented Feb 4, 2017

Copy link
Copy Markdown
Collaborator

⌛ Testing commit c3f9075 with merge 8fc0085...

@bors

bors commented Feb 5, 2017

Copy link
Copy Markdown
Collaborator

💔 Test failed - status-travis

@alexcrichton

Copy link
Copy Markdown
Member

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

@brson

brson commented Feb 5, 2017

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

@bors r=jseyfried

@bors

bors commented Feb 6, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 6519e8b has been approved by jseyfried

@bors

bors commented Feb 6, 2017

Copy link
Copy Markdown
Collaborator

⌛ 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

bors commented Feb 6, 2017

Copy link
Copy Markdown
Collaborator

☀️ 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