diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-36400.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-36400.rs b/src/test/ui/issues/issue-36400.rs new file mode 100644 index 000000000..a405f9b11 --- /dev/null +++ b/src/test/ui/issues/issue-36400.rs @@ -0,0 +1,6 @@ +fn f(x: &mut u32) {} + +fn main() { + let x = Box::new(3); + f(&mut *x); //~ ERROR cannot borrow `*x` as mutable, as `x` is not declared as mutable +} |