1- error: this will panic at run-time if the environment variable doesn't exist
2- --> $DIR/option_env_unwrap.rs:10 :13
1+ error: this will panic at run-time if the environment variable doesn't exist at compile-time
2+ --> $DIR/option_env_unwrap.rs:13 :13
33 |
44LL | let _ = option_env!("HOME").unwrap();
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 |
77 = note: `-D clippy::option-env-unwrap` implied by `-D warnings`
88 = help: consider using the `env!` macro instead
99
10- error: this will panic at run-time if the environment variable doesn't exist
10+ error: this will panic at run-time if the environment variable doesn't exist at compile-time
11+ --> $DIR/option_env_unwrap.rs:14:13
12+ |
13+ LL | let _ = option_env!("HOME").expect("environment variable HOME isn't set");
14+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15+ |
16+ = help: consider using the `env!` macro instead
17+
18+ error: this will panic at run-time if the environment variable doesn't exist at compile-time
1119 --> $DIR/option_env_unwrap.rs:5:9
1220 |
1321LL | option_env!($env).unwrap()
@@ -19,5 +27,17 @@ LL | let _ = option_env_unwrap!("HOME");
1927 = help: consider using the `env!` macro instead
2028 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
2129
22- error: aborting due to 2 previous errors
30+ error: this will panic at run-time if the environment variable doesn't exist at compile-time
31+ --> $DIR/option_env_unwrap.rs:8:9
32+ |
33+ LL | option_env!($env).expect($message)
34+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35+ ...
36+ LL | let _ = option_env_unwrap!("HOME", "environment variable HOME isn't set");
37+ | ----------------------------------------------------------------- in this macro invocation
38+ |
39+ = help: consider using the `env!` macro instead
40+ = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
41+
42+ error: aborting due to 4 previous errors
2343
0 commit comments