Skip to content

Conversation

samueltardieu
Copy link
Member

Commit 9ef6e21 introduced a check to ensure that Clippy doesn't consider a lifetime present in an explicit self types as being the default for an elided output lifetime. For example, elision did not work in the case like:

  fn func(self: &Rc<Self>, &str) -> &str {}

Since Rust 1.81.0, the lifetime in the self type is now considered the default for elision. Elision should then be suggested when appropriate.

changelog: [needless_lifetimes]: suggest elision of lifetimes present in explicit self types as well

r? @Alexendoo
because of #8278

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 13, 2025
Commit 9ef6e21 introduced a check to
ensure that Clippy doesn't consider a lifetime present in an explicit
self type as being the default for an elided output lifetime. For
example, elision did not work in the case like:

```rust
  fn func(self: &Rc<Self>, &str) -> &str { … }
```

Since Rust 1.81.0, the lifetime in the self type is now considered
the default for elision. Elision should then be suggested when
appropriate.
Copy link
Member

@Alexendoo Alexendoo left a comment

Choose a reason for hiding this comment

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

👍

@Alexendoo Alexendoo added this pull request to the merge queue Jan 14, 2025
Merged via the queue into rust-lang:master with commit 98761e4 Jan 14, 2025
11 checks passed
@samueltardieu samueltardieu deleted the push-xqstlqqyrkny branch January 14, 2025 22:58
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.

3 participants