summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-46604.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/issues/issue-46604.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-46604.rs b/src/test/ui/issues/issue-46604.rs
new file mode 100644
index 000000000..6ec6e7bdc
--- /dev/null
+++ b/src/test/ui/issues/issue-46604.rs
@@ -0,0 +1,7 @@
+static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; //~ ERROR mutable references are not allowed
+fn write<T: AsRef<[u8]>>(buffer: T) { }
+
+fn main() {
+ write(&buf);
+ buf[0]=2; //~ ERROR E0594
+}