diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-12-17 22:34:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-17 22:34:40 +0100 |
| commit | 938742e6878d509aeecc4c6b854384ee732e6a35 (patch) | |
| tree | 16e05b0f3c899619aab47533adbe1cce357d4aa8 /compiler/rustc_errors/src | |
| parent | a4cb3c831823d9baa56c3d90514b75b2660116fa (diff) | |
| parent | 44790c490902d3eb5871a13b80ac4d6c19909278 (diff) | |
| download | rust-938742e6878d509aeecc4c6b854384ee732e6a35.tar.gz rust-938742e6878d509aeecc4c6b854384ee732e6a35.zip | |
Rollup merge of #133265 - the8472:extract-if-ranges, r=cuviper
Add a range argument to vec.extract_if tracking issue: #43244 This adds the range argument requested in https://github.com/rust-lang/rust/issues/43244#issuecomment-2486160659
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 25d41462556..58fe3ec4b85 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -1569,18 +1569,18 @@ impl DiagCtxtInner { debug!(?diagnostic); debug!(?self.emitted_diagnostics); - let already_emitted_sub = |sub: &mut Subdiag| { + let not_yet_emitted = |sub: &mut Subdiag| { debug!(?sub); if sub.level != OnceNote && sub.level != OnceHelp { - return false; + return true; } let mut hasher = StableHasher::new(); sub.hash(&mut hasher); let diagnostic_hash = hasher.finish(); debug!(?diagnostic_hash); - !self.emitted_diagnostics.insert(diagnostic_hash) + self.emitted_diagnostics.insert(diagnostic_hash) }; - diagnostic.children.extract_if(already_emitted_sub).for_each(|_| {}); + diagnostic.children.retain_mut(not_yet_emitted); if already_emitted { let msg = "duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`"; diagnostic.sub(Note, msg, MultiSpan::new()); |
