]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const_let_promote.rs
Rollup merge of #107058 - clubby789:eqeq-homoglyph, r=wesleywiser
[rust.git] / tests / ui / consts / const_let_promote.rs
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 }