about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorclubby789 <jamie@hill-daniel.co.uk>2024-01-28 20:53:28 +0000
committerclubby789 <jamie@hill-daniel.co.uk>2024-02-13 21:03:34 +0000
commit4de3a3af4afd30fc86ba1c5a1681f571d530d16a (patch)
treedd6ab7065879f59c7518c1248f0aa4b99965ab71 /compiler/rustc_errors/src
parenta84bb95a1f65bfe25038f188763a18e096a86ab2 (diff)
downloadrust-4de3a3af4afd30fc86ba1c5a1681f571d530d16a.tar.gz
rust-4de3a3af4afd30fc86ba1c5a1681f571d530d16a.zip
Bump `indexmap`
`swap` has been deprecated in favour of `swap_remove` - the behaviour
is the same though.
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/emitter.rs3
-rw-r--r--compiler/rustc_errors/src/lib.rs3
2 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs
index b9e92dbb31c..38c6661377b 100644
--- a/compiler/rustc_errors/src/emitter.rs
+++ b/compiler/rustc_errors/src/emitter.rs
@@ -1635,7 +1635,8 @@ impl HumanEmitter {
                     let mut to_add = FxHashMap::default();
 
                     for (depth, style) in depths {
-                        if multilines.remove(&depth).is_none() {
+                        // FIXME(#120456) - is `swap_remove` correct?
+                        if multilines.swap_remove(&depth).is_none() {
                             to_add.insert(depth, style);
                         }
                     }
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index e033d66fccf..c07079af38f 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -707,7 +707,8 @@ impl DiagCtxt {
     pub fn steal_diagnostic(&self, span: Span, key: StashKey) -> Option<DiagnosticBuilder<'_, ()>> {
         let mut inner = self.inner.borrow_mut();
         let key = (span.with_parent(None), key);
-        let diag = inner.stashed_diagnostics.remove(&key)?;
+        // FIXME(#120456) - is `swap_remove` correct?
+        let diag = inner.stashed_diagnostics.swap_remove(&key)?;
         if diag.is_error() {
             if diag.is_lint.is_none() {
                 inner.stashed_err_count -= 1;