Skip to content

Add label to lint for lifetimes used once #51697

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 1 commit into from
Jun 23, 2018

Conversation

estebank
Copy link
Contributor

error: lifetime parameter `'a` only used once
  --> $DIR/fn-types.rs:19:10
   |
LL |   a: for<'a> fn(&'a u32), //~ ERROR `'a` only used once
   |          ^^      -- ...is used only here
   |          |
   |          this lifetime...

@rust-highfive
Copy link
Contributor

r? @eddyb

(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 Jun 22, 2018
@eddyb
Copy link
Member

eddyb commented Jun 22, 2018

r? @nikomatsakis

@rust-highfive rust-highfive assigned nikomatsakis and unassigned eddyb Jun 22, 2018
@oli-obk
Copy link
Contributor

oli-obk commented Jun 22, 2018

r? @oli-obk

Do you think it's worth making the removal a suggestion? It can get a little messy if the generics end up being empty afterwards, But since this is already an error, moving to another error seems fine, as long as the other error also has a suggestion

@estebank
Copy link
Contributor Author

estebank commented Jun 22, 2018

@oli-obk I was thinking of doing that as a follow up, as getting the right span for the suggestion requires dealing with leading and trailing commas, as well as the empty <> case. We also have to account for the total lifetime count introduced by the scope signature to suggest '_ only when appropriate.

@oli-obk
Copy link
Contributor

oli-obk commented Jun 22, 2018

@bors r+

Sgtm

@bors
Copy link
Collaborator

bors commented Jun 22, 2018

📌 Commit 973baaa has been approved by oli-obk

@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 Jun 22, 2018
@bors
Copy link
Collaborator

bors commented Jun 23, 2018

⌛ Testing commit 973baaa with merge f968633...

bors added a commit that referenced this pull request Jun 23, 2018
Add label to lint for lifetimes used once

```
error: lifetime parameter `'a` only used once
  --> $DIR/fn-types.rs:19:10
   |
LL |   a: for<'a> fn(&'a u32), //~ ERROR `'a` only used once
   |          ^^      -- ...is used only here
   |          |
   |          this lifetime...
```
@bors
Copy link
Collaborator

bors commented Jun 23, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: oli-obk
Pushing f968633 to master...

@bors bors merged commit 973baaa into rust-lang:master Jun 23, 2018
@estebank estebank deleted the once-used-lifetime-label branch November 9, 2023 05:24
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.

6 participants