|
| 1 | +warning: incorrect usage of `option_env!`, it will panic at run-time if the environment variable doesn't exist at compile-time |
| 2 | + --> $DIR/option_env_unwrap.rs:4:13 |
| 3 | + | |
| 4 | +LL | let _ = option_env!("PATH").unwrap(); |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 6 | + | |
| 7 | + = note: `#[warn(incorrect_option_env_unwraps)]` on by default |
| 8 | +help: consider using the `env!` macro instead |
| 9 | + | |
| 10 | +LL | let _ = env!("PATH"); |
| 11 | + | ~~~~~~~~~~~~ |
| 12 | + |
| 13 | +warning: incorrect usage of `option_env!`, it will panic at run-time if the environment variable doesn't exist at compile-time |
| 14 | + --> $DIR/option_env_unwrap.rs:6:13 |
| 15 | + | |
| 16 | +LL | let _ = option_env!("PATH").expect("environment variable PATH isn't set"); |
| 17 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 18 | + | |
| 19 | +help: consider using the `env!` macro instead |
| 20 | + | |
| 21 | +LL | let _ = env!("PATH"); |
| 22 | + | ~~~~~~~~~~~~ |
| 23 | + |
| 24 | +warning: incorrect usage of `option_env!`, it will panic at run-time if the environment variable doesn't exist at compile-time |
| 25 | + --> $DIR/option_env_unwrap.rs:8:13 |
| 26 | + | |
| 27 | +LL | let _ = option_env!("NOT_IN_ENV").unwrap(); |
| 28 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 29 | + | |
| 30 | +help: consider using the `env!` macro instead |
| 31 | + | |
| 32 | +LL | let _ = env!("NOT_IN_ENV"); |
| 33 | + | ~~~~~~~~~~~~~~~~~~ |
| 34 | + |
| 35 | +warning: incorrect usage of `option_env!`, it will panic at run-time if the environment variable doesn't exist at compile-time |
| 36 | + --> $DIR/option_env_unwrap.rs:10:13 |
| 37 | + | |
| 38 | +LL | let _ = option_env!("NOT_IN_ENV").expect("environment variable NOT_IN_ENV isn't set"); |
| 39 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 40 | + | |
| 41 | +help: consider using the `env!` macro instead |
| 42 | + | |
| 43 | +LL | let _ = env!("NOT_IN_ENV"); |
| 44 | + | ~~~~~~~~~~~~~~~~~~ |
| 45 | + |
| 46 | +warning: incorrect usage of `option_env!`, it will panic at run-time if the environment variable doesn't exist at compile-time |
| 47 | + --> $DIR/option_env_unwrap.rs:12:24 |
| 48 | + | |
| 49 | +LL | let _ = assert_ne!(option_env!("PATH").unwrap(), "a"); |
| 50 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 51 | + | |
| 52 | +help: consider using the `env!` macro instead |
| 53 | + | |
| 54 | +LL | let _ = assert_ne!(env!("PATH"), "a"); |
| 55 | + | ~~~~~~~~~~~~ |
| 56 | + |
| 57 | +warning: incorrect usage of `option_env!`, it will panic at run-time if the environment variable doesn't exist at compile-time |
| 58 | + --> $DIR/option_env_unwrap.rs:16:13 |
| 59 | + | |
| 60 | +LL | let _ = option_env!("PATH") |
| 61 | + | _____________^ |
| 62 | +LL | | |
| 63 | +LL | | .unwrap(); |
| 64 | + | |_________________^ |
| 65 | + | |
| 66 | +help: consider using the `env!` macro instead |
| 67 | + | |
| 68 | +LL | let _ = env!("PATH"); |
| 69 | + | ~~~~~~~~~~~~ |
| 70 | + |
| 71 | +warning: incorrect usage of `option_env!`, it will panic at run-time if the environment variable doesn't exist at compile-time |
| 72 | + --> $DIR/option_env_unwrap.rs:19:13 |
| 73 | + | |
| 74 | +LL | let _ = option_env!( |
| 75 | + | _____________^ |
| 76 | +LL | | |
| 77 | +LL | | "PATH" |
| 78 | +LL | | ) |
| 79 | +LL | | . unwrap(); |
| 80 | + | |__________________^ |
| 81 | + | |
| 82 | +help: consider using the `env!` macro instead |
| 83 | + | |
| 84 | +LL ~ let _ = env!( |
| 85 | +LL + |
| 86 | +LL + "PATH" |
| 87 | +LL ~ ); |
| 88 | + | |
| 89 | + |
| 90 | +warning: incorrect usage of `option_env!`, it will panic at run-time if the environment variable doesn't exist at compile-time |
| 91 | + --> $DIR/option_env_unwrap.rs:24:13 |
| 92 | + | |
| 93 | +LL | let _ = (option_env!("NOT_IN_ENV")).expect("aaa"); |
| 94 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 95 | + | |
| 96 | +help: consider using the `env!` macro instead |
| 97 | + | |
| 98 | +LL | let _ = env!("NOT_IN_ENV"); |
| 99 | + | ~~~~~~~~~~~~~~~~~~ |
| 100 | + |
| 101 | +warning: 8 warnings emitted |
| 102 | + |
0 commit comments