We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4313318 commit 2396af7Copy full SHA for 2396af7
tests/ui/pattern/deref-patterns/deref-box.rs
@@ -15,6 +15,11 @@ fn unbox_2<T>(b: Box<(T,)>) -> T {
15
x
16
}
17
18
+fn unbox_separately<T>(b: Box<(T, T)>) -> (T, T) {
19
+ let (x, _) = b else { unreachable!() };
20
+ let (_, y) = b else { unreachable!() };
21
+ (x, y)
22
+}
23
fn main() {
24
// test that deref patterns can move out of boxes
25
let b1 = Box::new(0);
0 commit comments