rust/tests/ui/option_env_unwrap.rs

17 lines
618 B
Rust
Raw Normal View History

//@aux-build:proc_macros.rs:proc-macro
2020-02-08 18:44:35 -06:00
#![warn(clippy::option_env_unwrap)]
#![allow(clippy::map_flatten)]
2020-02-08 18:44:35 -06:00
extern crate proc_macros;
use proc_macros::{external, inline_macros};
2020-02-08 18:44:35 -06:00
#[inline_macros]
2020-02-08 18:44:35 -06:00
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"));
2020-02-08 18:44:35 -06:00
}