]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/promoted-storage.rs
Rollup merge of #106699 - eholk:await-chains-drop-tracking, r=wesleywiser
[rust.git] / tests / ui / consts / promoted-storage.rs
1 // Check that storage statements reset local qualification.
2 // check-pass
3 use std::cell::Cell;
4
5 const C: Option<Cell<u32>> = {
6     let mut c = None;
7     let mut i = 0;
8     while i == 0 {
9         let mut x = None;
10         c = x;
11         x = Some(Cell::new(0));
12         let _ = x;
13         i += 1;
14     }
15     c
16 };
17
18 fn main() {
19     let _: &'static _ = &C;
20 }