about summary refs log tree commit diff
path: root/example
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2019-08-19 15:36:03 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2019-08-19 16:26:20 +0200
commitce860e5fdebd626d025d94d53629264923e441d8 (patch)
treedcd915288ff0d7276f509662327a13bf82c2ff29 /example
parent2a20cc0b94a60447c159095676d5813dd508d894 (diff)
downloadrust-ce860e5fdebd626d025d94d53629264923e441d8.tar.gz
rust-ce860e5fdebd626d025d94d53629264923e441d8.zip
Fix cross crate static duplicate codegen
Diffstat (limited to 'example')
-rw-r--r--example/mini_core.rs2
-rw-r--r--example/mini_core_hello_world.rs3
2 files changed, 5 insertions, 0 deletions
diff --git a/example/mini_core.rs b/example/mini_core.rs
index 78b493e0515..a271cb6e62e 100644
--- a/example/mini_core.rs
+++ b/example/mini_core.rs
@@ -529,3 +529,5 @@ pub macro line() { /* compiler built-in */ }
 #[rustc_builtin_macro]
 #[rustc_macro_transparency = "semitransparent"]
 pub macro cfg() { /* compiler built-in */ }
+
+pub static A_STATIC: u8 = 42;
diff --git a/example/mini_core_hello_world.rs b/example/mini_core_hello_world.rs
index 56a799be2fb..955530c7f91 100644
--- a/example/mini_core_hello_world.rs
+++ b/example/mini_core_hello_world.rs
@@ -261,4 +261,7 @@ fn main() {
     let f2 = -1000.0;
     assert_eq!(f2 as i8, -128);
     assert_eq!(f2 as u8, 0);
+
+    static ANOTHER_STATIC: &u8 = &A_STATIC;
+    assert_eq!(*ANOTHER_STATIC, 42);
 }