about summary refs log tree commit diff
path: root/tests/ui/static/reference-of-mut-static-unsafe-fn.rs
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-06-26 16:01:38 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-06-26 16:01:45 +0000
commit86c8eae7745b47ada8305dcdac16b7f2dbdd68c9 (patch)
tree5106049c25a1627cd237af19ac12f6fe479577de /tests/ui/static/reference-of-mut-static-unsafe-fn.rs
parent5988078aa20bf642bc1bbab15a45ac5cb74e77e2 (diff)
downloadrust-86c8eae7745b47ada8305dcdac16b7f2dbdd68c9.tar.gz
rust-86c8eae7745b47ada8305dcdac16b7f2dbdd68c9.zip
Automatically taint InferCtxt when errors are emitted
Diffstat (limited to 'tests/ui/static/reference-of-mut-static-unsafe-fn.rs')
-rw-r--r--tests/ui/static/reference-of-mut-static-unsafe-fn.rs26
1 files changed, 0 insertions, 26 deletions
diff --git a/tests/ui/static/reference-of-mut-static-unsafe-fn.rs b/tests/ui/static/reference-of-mut-static-unsafe-fn.rs
deleted file mode 100644
index 5652703a271..00000000000
--- a/tests/ui/static/reference-of-mut-static-unsafe-fn.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-//@ compile-flags: --edition 2024 -Z unstable-options
-
-fn main() {}
-
-unsafe fn _foo() {
-    static mut X: i32 = 1;
-    static mut Y: i32 = 1;
-
-    let _y = &X;
-    //~^ ERROR creating a shared reference to a mutable static [E0796]
-
-    let ref _a = X;
-    //~^ ERROR creating a shared reference to a mutable static [E0796]
-
-    let ref mut _a = X;
-    //~^ ERROR creating a mutable reference to a mutable static [E0796]
-
-    let (_b, _c) = (&X, &mut Y);
-    //~^ ERROR creating a shared reference to a mutable static [E0796]
-    //~^^ ERROR creating a mutable reference to a mutable static [E0796]
-
-    foo(&X);
-    //~^ ERROR creating a shared reference to a mutable static [E0796]
-}
-
-fn foo<'a>(_x: &'a i32) {}