2017-07-27 04:51:09 +00:00
|
|
|
#![allow(warnings)]
|
|
|
|
|
2015-01-08 11:02:42 +00:00
|
|
|
struct Struct { a: usize }
|
2014-10-07 04:16:35 +00:00
|
|
|
|
2015-01-08 11:02:42 +00:00
|
|
|
const C: usize = 1;
|
|
|
|
static S: usize = 1;
|
2014-10-07 04:16:35 +00:00
|
|
|
|
2015-01-08 11:02:42 +00:00
|
|
|
const T1: &'static usize = &C;
|
2024-01-05 11:18:11 +00:00
|
|
|
const T2: &'static usize = &S; //~ ERROR: referencing statics in constants
|
2015-01-08 11:02:42 +00:00
|
|
|
static T3: &'static usize = &C;
|
|
|
|
static T4: &'static usize = &S;
|
2014-10-07 04:16:35 +00:00
|
|
|
|
2015-01-08 11:02:42 +00:00
|
|
|
const T5: usize = C;
|
2024-01-05 11:18:11 +00:00
|
|
|
const T6: usize = S; //~ ERROR: referencing statics in constants
|
2015-01-08 11:02:42 +00:00
|
|
|
static T7: usize = C;
|
2018-05-29 00:38:18 +00:00
|
|
|
static T8: usize = S;
|
2014-10-07 04:16:35 +00:00
|
|
|
|
|
|
|
const T9: Struct = Struct { a: C };
|
2018-05-29 00:38:18 +00:00
|
|
|
const T10: Struct = Struct { a: S };
|
2024-01-05 11:18:11 +00:00
|
|
|
//~^ ERROR: referencing statics in constants
|
2014-10-07 04:16:35 +00:00
|
|
|
static T11: Struct = Struct { a: C };
|
2018-05-29 00:38:18 +00:00
|
|
|
static T12: Struct = Struct { a: S };
|
2014-10-07 04:16:35 +00:00
|
|
|
|
|
|
|
fn main() {}
|