]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rvalue-static-promotion.rs
Auto merge of #75936 - sdroege:chunks-exact-construction-bounds-check, r=nagisa
[rust.git] / src / test / ui / rvalue-static-promotion.rs
1 // run-pass
2
3 use std::cell::Cell;
4
5 const NONE_CELL_STRING: Option<Cell<String>> = None;
6
7 struct Foo<T>(T);
8 impl<T> Foo<T> {
9     const FOO: Option<Box<T>> = None;
10 }
11
12 fn main() {
13     let _: &'static u32 = &42;
14     let _: &'static Option<u32> = &None;
15
16     // We should be able to peek at consts and see they're None.
17     let _: &'static Option<Cell<String>> = &NONE_CELL_STRING;
18     let _: &'static Option<Box<()>> = &Foo::FOO;
19 }