diff options
| author | Michael Goulet <michael@errs.io> | 2025-02-20 18:58:46 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-02-22 22:24:52 +0000 |
| commit | 12e3911d81034864314503b9c2d9fba2773c7904 (patch) | |
| tree | 3c137d293516116a798effc67b2077dbb2025941 /compiler/rustc_session/src | |
| parent | 46420c96070b4c4bd8242f16d5806b8f26a57016 (diff) | |
Greatly simplify lifetime captures in edition 2024
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/parse.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_session/src/search_paths.rs | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index e0405a71f65..1fe521bd32d 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -329,7 +329,7 @@ impl ParseSess { self.proc_macro_quoted_spans.push(span) } - pub fn proc_macro_quoted_spans(&self) -> impl Iterator<Item = (usize, Span)> + '_ { + pub fn proc_macro_quoted_spans(&self) -> impl Iterator<Item = (usize, Span)> { // This is equivalent to `.iter().copied().enumerate()`, but that isn't possible for // AppendOnlyVec, so we resort to this scheme. self.proc_macro_quoted_spans.iter_enumerated() diff --git a/compiler/rustc_session/src/search_paths.rs b/compiler/rustc_session/src/search_paths.rs index b750d870cb6..00e12b45baf 100644 --- a/compiler/rustc_session/src/search_paths.rs +++ b/compiler/rustc_session/src/search_paths.rs @@ -20,12 +20,11 @@ pub struct FilesIndex(Vec<(Arc<str>, SearchPathFile)>); impl FilesIndex { /// Look up [SearchPathFile] by (prefix, suffix) pair. - pub fn query<'this, 'prefix, 'suffix>( - &'this self, - prefix: &'prefix str, - suffix: &'suffix str, - ) -> Option<impl Iterator<Item = (String, &'this SearchPathFile)> + use<'this, 'prefix, 'suffix>> - { + pub fn query<'s>( + &'s self, + prefix: &str, + suffix: &str, + ) -> Option<impl Iterator<Item = (String, &'s SearchPathFile)>> { let start = self.0.partition_point(|(k, _)| **k < *prefix); if start == self.0.len() { return None; |
