diff options
| author | bors <bors@rust-lang.org> | 2024-03-14 16:28:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-14 16:28:57 +0000 |
| commit | 8a78128e9de4d5fe1e8ab96d369c8827c05d9bb3 (patch) | |
| tree | eab7674dcf68d6cfd1a0c4cf18662bcf9785cd41 /tests/ui/patchable-function-entry/patchable-function-entry-flags.rs | |
| parent | e77d7a3f378be6ca894081eff5ed0379425f8d28 (diff) | |
| parent | f3879b3630f80f18fe2fbdbf048e3b693727c05b (diff) | |
| download | rust-8a78128e9de4d5fe1e8ab96d369c8827c05d9bb3.tar.gz rust-8a78128e9de4d5fe1e8ab96d369c8827c05d9bb3.zip | |
Auto merge of #12386 - Ethiraric:fix-12381, r=blyxyas
[`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
*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog: [`use_self`]: Have the lint trigger even if `Self` has generic lifetime parameters
Diffstat (limited to 'tests/ui/patchable-function-entry/patchable-function-entry-flags.rs')
0 files changed, 0 insertions, 0 deletions
