]> git.lizzy.rs Git - rust.git/blob - tests/ui/rfcs/rfc-2005-default-binding-mode/reset-mode.rs
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / ui / rfcs / rfc-2005-default-binding-mode / reset-mode.rs
1 // run-pass
2 // Test that we "reset" the mode as we pass through a `&` pattern.
3 //
4 // cc #46688
5
6 fn surprise(x: i32) {
7     assert_eq!(x, 2);
8 }
9
10 fn main() {
11     let x = &(1, &2);
12     let (_, &b) = x;
13     surprise(b);
14 }