about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2022-04-02 11:37:53 -0700
committerDavid Tolnay <dtolnay@gmail.com>2022-04-02 11:38:11 -0700
commitc20f8d2fd62344658b53cccf7b599eeb9a8d1de6 (patch)
tree777dda085be7e287bd18731233c0aaa812c3627e
parentfbc45b650a9c517ca87b0af8f108efbf50689299 (diff)
downloadrust-c20f8d2fd62344658b53cccf7b599eeb9a8d1de6.tar.gz
rust-c20f8d2fd62344658b53cccf7b599eeb9a8d1de6.zip
Add test of thread_local! breaking on redefined u8
-rw-r--r--src/test/ui/thread-local/name-collision.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/thread-local/name-collision.rs b/src/test/ui/thread-local/name-collision.rs
new file mode 100644
index 00000000000..dcff9183ad9
--- /dev/null
+++ b/src/test/ui/thread-local/name-collision.rs
@@ -0,0 +1,15 @@
+// check-pass
+
+#[allow(non_camel_case_types)]
+struct u8;
+
+std::thread_local! {
+    pub static A: i32 = f();
+    pub static B: i32 = const { 0 };
+}
+
+fn f() -> i32 {
+    0
+}
+
+fn main() {}