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

2018 edition - confusing error message when declaring unnamed parameters #56584

Merged
merged 2 commits into from Dec 15, 2018

Conversation

Projects
None yet
7 participants
@davidtwco
Member

davidtwco commented Dec 7, 2018

Fixes #53990.

This PR adds a note providing context for the change to argument
names being required in the 2018 edition for trait methods and a
suggestion for the fix.

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Dec 7, 2018

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@Nemo157

This comment was marked as resolved.

Contributor

Nemo157 commented Dec 7, 2018

It seems like the compatibility warning and the hard error could use similar error messages (playground)

error: anonymous parameters are deprecated and will be removed in the next edition.
 --> src/lib.rs:4:13
  |
4 |     fn func(u8);
  |             ^^ help: Try naming the parameter or explicitly ignoring it: `_: u8`
  |
[...]
  = note: #[deny(anonymous_parameters)] implied by #[deny(rust_2018_compatibility)]
@eddyb

This comment has been minimized.

Member

eddyb commented Dec 7, 2018

@rust-highfive rust-highfive assigned nikomatsakis and unassigned eddyb Dec 7, 2018

davidtwco added some commits Dec 7, 2018

Add context for RFC 1685 change in 2018 edition.
This commit adds a note providing context for the change to argument
names being required in the 2018 edition for trait methods.
Add suggestion for underscore binding fix.
This commit emits a suggestion for adding an underscore binding to
arguments in trait methods that previously did not have a argument name
specified.

@davidtwco davidtwco force-pushed the davidtwco:issue-53990 branch from 9d1f89e to 7fcf31b Dec 7, 2018

@davidtwco

This comment has been minimized.

Member

davidtwco commented Dec 7, 2018

It seems like the compatibility warning and the hard error could use the same/similar error messages (playground)

Ah, good point @Nemo157. I've updated the messages.

@nikomatsakis

This comment has been minimized.

Contributor

nikomatsakis commented Dec 11, 2018

@bors r+

@bors

This comment has been minimized.

Contributor

bors commented Dec 11, 2018

📌 Commit 7fcf31b has been approved by nikomatsakis

@bors

This comment has been minimized.

Contributor

bors commented Dec 11, 2018

⌛️ Testing commit 7fcf31b with merge e8c8d27...

bors added a commit that referenced this pull request Dec 11, 2018

Auto merge of #56584 - davidtwco:issue-53990, r=nikomatsakis
2018 edition - confusing error message when declaring unnamed parameters

Fixes #53990.

This PR adds a note providing context for the change to argument
names being required in the 2018 edition for trait methods and a
suggestion for the fix.
@bors

This comment has been minimized.

Contributor

bors commented Dec 11, 2018

💔 Test failed - status-appveyor

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Dec 11, 2018

Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
Checking out files: 100% (17616/17616), done.
travis_time:end:08c8ad60:start=1544571738042518000,finish=1544571750320195000,duration=12277677000
$ cd rust-lang/rust
$ git checkout -qf e8c8d274b0b611a5d4711af6095d477729436e30
fatal: reference is not a tree: e8c8d274b0b611a5d4711af6095d477729436e30
The command "git checkout -qf e8c8d274b0b611a5d4711af6095d477729436e30" failed and exited with 128 during .
Your build has been stopped.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented Dec 11, 2018

@bors: retry

  • CI automation hiccup
@bors

This comment has been minimized.

Contributor

bors commented Dec 15, 2018

⌛️ Testing commit 7fcf31b with merge 747a5e5...

bors added a commit that referenced this pull request Dec 15, 2018

Auto merge of #56584 - davidtwco:issue-53990, r=nikomatsakis
2018 edition - confusing error message when declaring unnamed parameters

Fixes #53990.

This PR adds a note providing context for the change to argument
names being required in the 2018 edition for trait methods and a
suggestion for the fix.
@bors

This comment has been minimized.

Contributor

bors commented Dec 15, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 747a5e5 to master...

@bors bors merged commit 7fcf31b into rust-lang:master Dec 15, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@davidtwco davidtwco deleted the davidtwco:issue-53990 branch Dec 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment