]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/miri/src/diagnostics.rs
Rollup merge of #107048 - DebugSteven:newer-x-check-cargo, r=albertlarsan68
[rust.git] / src / tools / miri / src / diagnostics.rs
index 2087d0cb548fd4119aab10ea20a1896afc130a42..035c0e6423381fb3f1a3c63ccb2b79add3a6152b 100644 (file)
@@ -69,7 +69,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
             DataRace { ptr, op1, op2 } =>
                 write!(
                     f,
-                    "Data race detected between (1) {} on {} and (2) {} on {} at {ptr:?}. (1) just happened here",
+                    "Data race detected between (1) {} on {} and (2) {} on {} at {ptr:?}. (2) just happened here",
                     op1.action, op1.thread_info, op2.action, op2.thread_info
                 ),
         }
@@ -222,9 +222,9 @@ pub fn report_error<'tcx, 'mir>(
                 vec![(Some(*span), format!("the `{link_name}` symbol is defined here"))],
             Int2PtrWithStrictProvenance =>
                 vec![(None, format!("use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead"))],
-            DataRace { op2, .. } =>
+            DataRace { op1, .. } =>
                 vec![
-                    (Some(op2.span), format!("and (2) occurred earlier here")),
+                    (Some(op1.span), format!("and (1) occurred earlier here")),
                     (None, format!("this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior")),
                     (None, format!("see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information")),
                 ],