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