We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e0ef87f commit 3a0c0e9Copy full SHA for 3a0c0e9
1 file changed
library/coretests/tests/macros.rs
@@ -236,9 +236,12 @@ impl Drop for MutRefWithDrop<'_> {
236
fn temporary_scope_introduction() {
237
// Fails to compile if the macros don't introduce a temporary scope, since `&mut val` would
238
// create a second mutable borrow while `MutRefWithDrop` still holds a unique ref.
239
+ // See https://github.com/rust-lang/rust/issues/154406 for reference.
240
let mut val = 0;
241
242
(assert_matches!(*MutRefWithDrop(&mut val).0, 0), std::mem::take(&mut val));
243
+ (assert_matches!(*MutRefWithDrop(&mut val).0, 0, "msg"), std::mem::take(&mut val));
244
245
(debug_assert_matches!(*MutRefWithDrop(&mut val).0, 0), std::mem::take(&mut val));
246
+ (debug_assert_matches!(*MutRefWithDrop(&mut val).0, 0, "msg"), std::mem::take(&mut val));
247
}
0 commit comments