Skip to content

Do not suggest duplicate 'a lifetime #75000

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

Closed
wants to merge 1 commit into from

Conversation

JohnTitor
Copy link
Member

Fixes #72404
r? @estebank

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 1, 2020
Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I thought I had replied to this already, but alas clearly I don't know how to use mobile github.

I have a more comprehensible handling of this in #75372.

(param.span.shrink_to_lo(), "'a, ".to_string())
if param.name.ident().as_str().contains("'a") {
// Do not add duplicate lifetime.
None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know there's a function somewhere to get the next one letter name. Could we use that instead? On mobile so I can't find it back can look for it tomorrow.

help: consider making the bound lifetime-generic with a new `'a` lifetime
|
LL | struct S<'a>(&'a dyn for<'a> Fn(&'a X) -> &X<'a>);
| ^^^^^^^ ^^^^^ ^^^^^
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also deal with this case and suggest for<'b> instead?

@JohnTitor
Copy link
Member Author

I have a more comprehensible handling of this in #75372.

At a glance, it looks greater than this, I'm going to close this in favor of the above. Thanks for the follow-up!

@JohnTitor JohnTitor closed this Aug 11, 2020
@JohnTitor JohnTitor deleted the dont-sugg-dup-a branch August 11, 2020 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On missing HRLT annotation, we sometimes provide a slightly incorrect suggestion
3 participants