blob: 03d5f8bb3f1c9591b37b5703a468055ee2b83afb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#![allow(warnings)]
struct Struct { a: usize }
const C: usize = 1;
static S: usize = 1;
const T1: &'static usize = &C;
const T2: &'static usize = &S; //~ ERROR: constants cannot refer to statics
static T3: &'static usize = &C;
static T4: &'static usize = &S;
const T5: usize = C;
const T6: usize = S; //~ ERROR: constants cannot refer to statics
static T7: usize = C;
static T8: usize = S;
const T9: Struct = Struct { a: C };
const T10: Struct = Struct { a: S };
//~^ ERROR: constants cannot refer to statics
static T11: Struct = Struct { a: C };
static T12: Struct = Struct { a: S };
fn main() {}
|