diff options
Diffstat (limited to 'tests/ui/rfcs/rfc-2005-default-binding-mode/reset-mode.rs')
-rw-r--r-- | tests/ui/rfcs/rfc-2005-default-binding-mode/reset-mode.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/reset-mode.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/reset-mode.rs new file mode 100644 index 000000000..3b9d07610 --- /dev/null +++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/reset-mode.rs @@ -0,0 +1,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); +} |