2019-07-26 16:54:25 -05:00
|
|
|
// run-pass
|
|
|
|
|
2017-08-26 17:27:58 -05:00
|
|
|
use std::cell::Cell;
|
|
|
|
|
|
|
|
const NONE_CELL_STRING: Option<Cell<String>> = None;
|
|
|
|
|
2022-07-25 15:36:03 -05:00
|
|
|
struct Foo<T>(#[allow(unused_tuple_struct_fields)] T);
|
2017-08-26 17:27:58 -05:00
|
|
|
impl<T> Foo<T> {
|
|
|
|
const FOO: Option<Box<T>> = None;
|
|
|
|
}
|
|
|
|
|
2017-03-11 09:54:45 -06:00
|
|
|
fn main() {
|
2017-08-26 17:27:58 -05:00
|
|
|
let _: &'static u32 = &42;
|
|
|
|
let _: &'static Option<u32> = &None;
|
|
|
|
|
|
|
|
// We should be able to peek at consts and see they're None.
|
|
|
|
let _: &'static Option<Cell<String>> = &NONE_CELL_STRING;
|
|
|
|
let _: &'static Option<Box<()>> = &Foo::FOO;
|
2017-03-12 17:31:17 -05:00
|
|
|
}
|