diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-09-01 03:58:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-01 03:58:03 +0200 |
| commit | 1063c0dd37bda8913ffc5548735ffeea14eb6123 (patch) | |
| tree | 132365092adafdb9a586a0ebb25f936691d6e9e5 /src/tools/rust-analyzer | |
| parent | da65b9064f624e559987e4e64d678a0a309e8939 (diff) | |
| parent | a9b959a020cc156ef57a972c83381aabc43b1174 (diff) | |
| download | rust-1063c0dd37bda8913ffc5548735ffeea14eb6123.tar.gz rust-1063c0dd37bda8913ffc5548735ffeea14eb6123.zip | |
Rollup merge of #129207 - GrigorenkoPV:elided-is-named, r=cjgillot
Lint that warns when an elided lifetime ends up being a named lifetime As suggested in https://github.com/rust-lang/rust/issues/48686#issuecomment-1817334575 Fixes #48686
Diffstat (limited to 'src/tools/rust-analyzer')
| -rw-r--r-- | src/tools/rust-analyzer/crates/hir-def/src/attr.rs | 4 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/crates/hir-def/src/body.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/rust-analyzer/crates/hir-def/src/attr.rs b/src/tools/rust-analyzer/crates/hir-def/src/attr.rs index 198dc93f6b1..c0547bc3c8d 100644 --- a/src/tools/rust-analyzer/crates/hir-def/src/attr.rs +++ b/src/tools/rust-analyzer/crates/hir-def/src/attr.rs @@ -117,7 +117,7 @@ impl Attrs { } impl Attrs { - pub fn by_key<'attrs>(&'attrs self, key: &'attrs Symbol) -> AttrQuery<'_> { + pub fn by_key<'attrs>(&'attrs self, key: &'attrs Symbol) -> AttrQuery<'attrs> { AttrQuery { attrs: self, key } } @@ -594,7 +594,7 @@ impl<'attr> AttrQuery<'attr> { /// #[doc(html_root_url = "url")] /// ^^^^^^^^^^^^^ key /// ``` - pub fn find_string_value_in_tt(self, key: &'attr Symbol) -> Option<&str> { + pub fn find_string_value_in_tt(self, key: &'attr Symbol) -> Option<&'attr str> { self.tt_values().find_map(|tt| { let name = tt.token_trees.iter() .skip_while(|tt| !matches!(tt, tt::TokenTree::Leaf(tt::Leaf::Ident(tt::Ident { sym, ..} )) if *sym == *key)) diff --git a/src/tools/rust-analyzer/crates/hir-def/src/body.rs b/src/tools/rust-analyzer/crates/hir-def/src/body.rs index f5fe8f87701..dde1f142ab0 100644 --- a/src/tools/rust-analyzer/crates/hir-def/src/body.rs +++ b/src/tools/rust-analyzer/crates/hir-def/src/body.rs @@ -197,7 +197,7 @@ impl Body { pub fn blocks<'a>( &'a self, db: &'a dyn DefDatabase, - ) -> impl Iterator<Item = (BlockId, Arc<DefMap>)> + '_ { + ) -> impl Iterator<Item = (BlockId, Arc<DefMap>)> + 'a { self.block_scopes.iter().map(move |&block| (block, db.block_def_map(block))) } |
