From 9f751a9c5a03bfa3d04cc34f4ba46ff0c3699547 Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Mon, 4 Jun 2018 23:48:00 +0100 Subject: [PATCH] Added incremental test for interlinking static references. --- .../static_refering_to_other_static3/issue.rs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/test/incremental/static_refering_to_other_static3/issue.rs diff --git a/src/test/incremental/static_refering_to_other_static3/issue.rs b/src/test/incremental/static_refering_to_other_static3/issue.rs new file mode 100644 index 00000000000..f19ae9e0e8d --- /dev/null +++ b/src/test/incremental/static_refering_to_other_static3/issue.rs @@ -0,0 +1,25 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// revisions:rpass1 rpass2 + +#[cfg(rpass1)] +pub static A: u8 = 42; +#[cfg(rpass2)] +pub static A: u8 = 43; + +static B: &u8 = &C.1; +static C: (&&u8, u8) = (&B, A); + +fn main() { + assert_eq!(*B, A); + assert_eq!(**C.0, A); + assert_eq!(C.1, A); +}