about summary refs log tree commit diff
path: root/tests/ui/statics/nested_struct.rs
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-02-26 18:03:06 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-03-12 05:53:46 +0000
commitd3514a036dc65c1d31ee5b1b4bd58b9be1edf5af (patch)
tree95685bb9f89cc23836f86c958b346447e8fd5356 /tests/ui/statics/nested_struct.rs
parent92414ab25d5b9ddbee37d458e53e70ee4813d5ca (diff)
downloadrust-d3514a036dc65c1d31ee5b1b4bd58b9be1edf5af.tar.gz
rust-d3514a036dc65c1d31ee5b1b4bd58b9be1edf5af.zip
Ensure nested allocations in statics do not get deduplicated
Diffstat (limited to 'tests/ui/statics/nested_struct.rs')
-rw-r--r--tests/ui/statics/nested_struct.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/statics/nested_struct.rs b/tests/ui/statics/nested_struct.rs
new file mode 100644
index 00000000000..f5819f50789
--- /dev/null
+++ b/tests/ui/statics/nested_struct.rs
@@ -0,0 +1,24 @@
+//@ check-pass
+/// oli-obk added this test after messing up the interner logic
+/// around mutability of nested allocations. This was not caught
+/// by the test suite, but by trying to build stage2 rustc.
+/// There is no real explanation for this test, as it was just
+/// a bug during a refactoring.
+
+pub struct Lint {
+    pub name: &'static str,
+    pub desc: &'static str,
+    pub report_in_external_macro: bool,
+    pub is_loaded: bool,
+    pub crate_level_only: bool,
+}
+
+static FOO: &Lint = &Lint {
+    name: &"foo",
+    desc: "desc",
+    report_in_external_macro: false,
+    is_loaded: true,
+    crate_level_only: false,
+};
+
+fn main() {}