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
3
3
|
4
4
LL | let _ = option_env!("HOME").unwrap();
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
|
7
7
= note: `-D clippy::option-env-unwrap` implied by `-D warnings`
8
8
= help: consider using the `env!` macro instead
9
9
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
11
19
--> $DIR/option_env_unwrap.rs:5:9
12
20
|
13
21
LL | option_env!($env).unwrap()
@@ -19,5 +27,17 @@ LL | let _ = option_env_unwrap!("HOME");
19
27
= help: consider using the `env!` macro instead
20
28
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
21
29
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
23
43
0 commit comments