rust-clippy/tests/ui/option_env_unwrap.rs
2023-03-12 17:24:36 -04:00

16 lines
607 B
Rust

// aux-build:proc_macros.rs
#![warn(clippy::option_env_unwrap)]
#![allow(clippy::map_flatten)]
extern crate proc_macros;
use proc_macros::{external, inline_macros};
#[inline_macros]
fn main() {
let _ = option_env!("PATH").unwrap();
let _ = option_env!("PATH").expect("environment variable PATH isn't set");
let _ = inline!(option_env!($"PATH").unwrap());
let _ = inline!(option_env!($"PATH").expect($"environment variable PATH isn't set"));
let _ = external!(option_env!($"PATH").unwrap());
let _ = external!(option_env!($"PATH").expect($"environment variable PATH isn't set"));
}