From 3a0c0e9cb7b3797dd8f669a317d703fe74dfbfe7 Mon Sep 17 00:00:00 2001 From: Lukas Bergdoll Date: Sat, 18 Apr 2026 15:12:33 +0200 Subject: [PATCH] Apply review feedback --- library/coretests/tests/macros.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/coretests/tests/macros.rs b/library/coretests/tests/macros.rs index 52435b226e65..9f73ebd253c3 100644 --- a/library/coretests/tests/macros.rs +++ b/library/coretests/tests/macros.rs @@ -236,9 +236,12 @@ fn drop(&mut self) { fn temporary_scope_introduction() { // Fails to compile if the macros don't introduce a temporary scope, since `&mut val` would // create a second mutable borrow while `MutRefWithDrop` still holds a unique ref. + // See https://github.com/rust-lang/rust/issues/154406 for reference. let mut val = 0; (assert_matches!(*MutRefWithDrop(&mut val).0, 0), std::mem::take(&mut val)); + (assert_matches!(*MutRefWithDrop(&mut val).0, 0, "msg"), std::mem::take(&mut val)); (debug_assert_matches!(*MutRefWithDrop(&mut val).0, 0), std::mem::take(&mut val)); + (debug_assert_matches!(*MutRefWithDrop(&mut val).0, 0, "msg"), std::mem::take(&mut val)); }