1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 struct Struct { a: usize }
18 const T1: &'static usize = &C;
19 const T2: &'static usize = &S; //~ ERROR: constants cannot refer to statics
20 static T3: &'static usize = &C;
21 static T4: &'static usize = &S;
24 const T6: usize = S; //~ ERROR: constants cannot refer to statics
28 const T9: Struct = Struct { a: C };
29 const T10: Struct = Struct { a: S };
30 //~^ ERROR: constants cannot refer to statics
31 static T11: Struct = Struct { a: C };
32 static T12: Struct = Struct { a: S };