about summary refs log tree commit diff
path: root/tests/ui/rfcs/rfc-2005-default-binding-mode/reset-mode.rs
blob: 1d9bd4d16fc96025fb318cc31bead706549e8ff0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//@ run-pass
// Test that we "reset" the mode as we pass through a `&` pattern.
//
// cc #46688

fn surprise(x: i32) {
    assert_eq!(x, 2);
}

fn main() {
    let x = &(1, &2);
    let (_, &b) = x;
    surprise(b);
}