diff options
| author | Ethiraric <ethiraric@gmail.com> | 2024-02-29 14:13:54 +0100 |
|---|---|---|
| committer | Ethiraric <ethiraric@gmail.com> | 2024-03-07 20:45:59 +0100 |
| commit | f3879b3630f80f18fe2fbdbf048e3b693727c05b (patch) | |
| tree | 78c66eef3c9e57257bebafadd4e17528564cef17 /tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs | |
| parent | 93f0a9a91f58c9b2153868f458402155fb6265bb (diff) | |
| download | rust-f3879b3630f80f18fe2fbdbf048e3b693727c05b.tar.gz rust-f3879b3630f80f18fe2fbdbf048e3b693727c05b.zip | |
[`use_self`]: Make it aware of lifetimes
Have the lint trigger even if `Self` has generic lifetime parameters.
```rs
impl<'a> Foo<'a> {
type Item = Foo<'a>; // Can be replaced with Self
fn new() -> Self {
Foo { // No lifetime, but they are inferred to be that of Self
// Can be replaced as well
...
}
}
// Don't replace `Foo<'b>`, the lifetime is different!
fn eq<'b>(self, other: Foo<'b>) -> bool {
..
}
```
Fixes #12381
Diffstat (limited to 'tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs')
0 files changed, 0 insertions, 0 deletions
