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