Apply review feedback

This commit is contained in:
Lukas Bergdoll
2026-04-18 15:12:33 +02:00
parent e0ef87f880
commit 3a0c0e9cb7
+3
View File
@@ -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));
}