2019-07-26 21:54:25 +00:00
|
|
|
// run-pass
|
|
|
|
|
2017-08-26 22:27:58 +00:00
|
|
|
use std::cell::Cell;
|
|
|
|
|
|
|
|
const NONE_CELL_STRING: Option<Cell<String>> = None;
|
|
|
|
|
2023-12-27 22:11:58 +00:00
|
|
|
struct Foo<T>(#[allow(dead_code)] T);
|
2017-08-26 22:27:58 +00:00
|
|
|
impl<T> Foo<T> {
|
|
|
|
const FOO: Option<Box<T>> = None;
|
|
|
|
}
|
|
|
|
|
2017-03-11 15:54:45 +00:00
|
|
|
fn main() {
|
2017-08-26 22:27:58 +00: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 22:31:17 +00:00
|
|
|
}
|