]>
Commit | Line | Data |
---|---|---|
60c5eb7d XL |
1 | // run-pass |
2 | ||
3 | use std::cell::Cell; | |
4 | ||
5 | const X: Option<Cell<i32>> = None; | |
6 | ||
7 | const Y: Option<Cell<i32>> = { | |
8 | let x = None; | |
9 | x | |
10 | }; | |
11 | ||
12 | // Ensure that binding the final value of a `const` to a variable does not affect promotion. | |
13 | #[allow(unused)] | |
14 | fn main() { | |
15 | let x: &'static _ = &X; | |
16 | let y: &'static _ = &Y; | |
17 | } |