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