Skip to content

Custom diagnostic when trying to doc comment argument #55451

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

Merged
merged 3 commits into from
Nov 5, 2018

Conversation

estebank
Copy link
Contributor

When writing

pub fn f(
    /// Comment
    id: u8,
) {}

Produce a targeted diagnostic

error: documentation comments cannot be applied to method arguments
  --> $DIR/fn-arg-doc-comment.rs:2:5
   |
LL |     /// Comment
   |     ^^^^^^^^^^^ doc comments are not allowed here

Fix #54801.

Before parsing argument names and types, try to consume an incorrectly
included doc comment or attribute in order to recover and continue
parsing the rest of the fn definition.
@rust-highfive
Copy link
Contributor

r? @pnkfelix

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 28, 2018
@rust-highfive

This comment has been minimized.

@estebank
Copy link
Contributor Author

@bors try

I want to get a crater run to make sure that the check for attributes doesn't break any proc macro.

@bors
Copy link
Collaborator

bors commented Oct 29, 2018

⌛ Trying commit adb96ec with merge 94d9b43...

bors added a commit that referenced this pull request Oct 29, 2018
Custom diagnostic when trying to doc comment argument

When writing

```
pub fn f(
    /// Comment
    id: u8,
) {}
```

Produce a targeted diagnostic

```
error: documentation comments cannot be applied to method arguments
  --> $DIR/fn-arg-doc-comment.rs:2:5
   |
LL |     /// Comment
   |     ^^^^^^^^^^^ doc comments are not allowed here
```

Fix #54801.
@bors
Copy link
Collaborator

bors commented Oct 29, 2018

☀️ Test successful - status-travis
State: approved= try=True

@estebank
Copy link
Contributor Author

@craterbot run start=master#d586d5d2f51489821b471f20959333558c24b129 end=try#94d9b43c3e99c9a335e38fb37a6df091ecad3974 mode=check-only

@craterbot
Copy link
Collaborator

👌 Experiment pr-55451 created and queued.
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🚧 Experiment pr-55451 is now running on agent aws-2.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 29, 2018
@craterbot
Copy link
Collaborator

🎉 Experiment pr-55451 is completed!
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Oct 31, 2018
@pnkfelix
Copy link
Member

pnkfelix commented Nov 5, 2018

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 5, 2018

📌 Commit adb96ec has been approved by pnkfelix

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 5, 2018
@bors
Copy link
Collaborator

bors commented Nov 5, 2018

⌛ Testing commit adb96ec with merge af791bb...

bors added a commit that referenced this pull request Nov 5, 2018
Custom diagnostic when trying to doc comment argument

When writing

```
pub fn f(
    /// Comment
    id: u8,
) {}
```

Produce a targeted diagnostic

```
error: documentation comments cannot be applied to method arguments
  --> $DIR/fn-arg-doc-comment.rs:2:5
   |
LL |     /// Comment
   |     ^^^^^^^^^^^ doc comments are not allowed here
```

Fix #54801.
@bors
Copy link
Collaborator

bors commented Nov 5, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: pnkfelix
Pushing af791bb to master...

@bors bors merged commit adb96ec into rust-lang:master Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants