From aaba692effbcaff0acc6a0700f66818b648cdf47 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 7 Feb 2017 20:38:23 +0100 Subject: [PATCH] add regression test for #120 --- tests/run-pass/recursive_static.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/run-pass/recursive_static.rs diff --git a/tests/run-pass/recursive_static.rs b/tests/run-pass/recursive_static.rs new file mode 100644 index 0000000000..5b27324964 --- /dev/null +++ b/tests/run-pass/recursive_static.rs @@ -0,0 +1,11 @@ +#![feature(static_recursion)] + +struct S(&'static S); +static S1: S = S(&S2); +static S2: S = S(&S1); + +fn main() { + let p: *const S = S2.0; + let q: *const S = &S1; + assert_eq!(p, q); +}