about summary refs log tree commit diff
path: root/tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-03-14 16:28:57 +0000
committerbors <bors@rust-lang.org>2024-03-14 16:28:57 +0000
commit8a78128e9de4d5fe1e8ab96d369c8827c05d9bb3 (patch)
treeeab7674dcf68d6cfd1a0c4cf18662bcf9785cd41 /tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs
parente77d7a3f378be6ca894081eff5ed0379425f8d28 (diff)
parentf3879b3630f80f18fe2fbdbf048e3b693727c05b (diff)
downloadrust-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/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs')
0 files changed, 0 insertions, 0 deletions