aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/macros/builtin/option_env1.rs
blob: cf9f65b0ea4a3efef55c2df8fe5edd8774fe676e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#![feature(rustc_attrs)]

#[rustc_builtin_macro]
macro_rules! option_env {
    () => {}
}

#[lang = "sized"]
trait Sized {}

pub mod core {
    pub mod option {
        pub enum Option<T> {
            #[lang = "Some"]
            Some(T),
            #[lang = "None"]
            None,
        }
    }
}

use core::option::Option;


fn main() {
    // Both a guaranteed-to-exist variable and a failed find should compile
    let _: Option<&str> = option_env!("PWD");
    let _: Option<&str> = option_env!("PROBABLY_DOESNT_EXIST");
}