diff options
Diffstat (limited to 'tests/ui/nll/borrow-use-issue-46875.rs')
-rw-r--r-- | tests/ui/nll/borrow-use-issue-46875.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/nll/borrow-use-issue-46875.rs b/tests/ui/nll/borrow-use-issue-46875.rs new file mode 100644 index 000000000..42e28b967 --- /dev/null +++ b/tests/ui/nll/borrow-use-issue-46875.rs @@ -0,0 +1,18 @@ +// run-pass + +fn vec() { + let mut _x = vec!['c']; + let _y = &_x; + _x = Vec::new(); +} + +fn int() { + let mut _x = 5; + let _y = &_x; + _x = 7; +} + +fn main() { + vec(); + int(); +} |