|
| 1 | +error[E0133]: call to unsafe function `std::env::set_var` is unsafe and requires unsafe block |
| 2 | + --> $DIR/unsafe-env.rs:10:5 |
| 3 | + | |
| 4 | +LL | env::set_var("FOO", "BAR"); |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function |
| 6 | + | |
| 7 | + = note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668> |
| 8 | + = note: consult the function's documentation for information on how to avoid undefined behavior |
| 9 | +note: an unsafe function restricts its caller, but its body is safe by default |
| 10 | + --> $DIR/unsafe-env.rs:9:1 |
| 11 | + | |
| 12 | +LL | unsafe fn unsafe_fn() { |
| 13 | + | ^^^^^^^^^^^^^^^^^^^^^ |
| 14 | +note: the lint level is defined here |
| 15 | + --> $DIR/unsafe-env.rs:8:8 |
| 16 | + | |
| 17 | +LL | #[deny(unsafe_op_in_unsafe_fn)] |
| 18 | + | ^^^^^^^^^^^^^^^^^^^^^^ |
| 19 | + |
| 20 | +error[E0133]: call to unsafe function `std::env::remove_var` is unsafe and requires unsafe block |
| 21 | + --> $DIR/unsafe-env.rs:12:5 |
| 22 | + | |
| 23 | +LL | env::remove_var("FOO"); |
| 24 | + | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function |
| 25 | + | |
| 26 | + = note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668> |
| 27 | + = note: consult the function's documentation for information on how to avoid undefined behavior |
| 28 | + |
| 29 | +error[E0133]: call to unsafe function `unsafe_fn` is unsafe and requires unsafe block |
| 30 | + --> $DIR/unsafe-env.rs:15:9 |
| 31 | + | |
| 32 | +LL | unsafe_fn(); |
| 33 | + | ^^^^^^^^^^^ call to unsafe function |
| 34 | + | |
| 35 | + = note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668> |
| 36 | + = note: consult the function's documentation for information on how to avoid undefined behavior |
| 37 | + |
1 | 38 | error[E0133]: call to unsafe function `set_var` is unsafe and requires unsafe block
|
2 |
| - --> $DIR/unsafe-env.rs:13:5 |
| 39 | + --> $DIR/unsafe-env.rs:23:5 |
3 | 40 | |
|
4 | 41 | LL | env::set_var("FOO", "BAR");
|
5 | 42 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
6 | 43 | |
|
7 | 44 | = note: consult the function's documentation for information on how to avoid undefined behavior
|
8 | 45 |
|
9 | 46 | error[E0133]: call to unsafe function `remove_var` is unsafe and requires unsafe block
|
10 |
| - --> $DIR/unsafe-env.rs:15:5 |
| 47 | + --> $DIR/unsafe-env.rs:25:5 |
11 | 48 | |
|
12 | 49 | LL | env::remove_var("FOO");
|
13 | 50 | | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
14 | 51 | |
|
15 | 52 | = note: consult the function's documentation for information on how to avoid undefined behavior
|
16 | 53 |
|
17 | 54 | error[E0133]: call to unsafe function `unsafe_fn` is unsafe and requires unsafe block
|
18 |
| - --> $DIR/unsafe-env.rs:23:5 |
| 55 | + --> $DIR/unsafe-env.rs:33:5 |
19 | 56 | |
|
20 | 57 | LL | unsafe_fn();
|
21 | 58 | | ^^^^^^^^^^^ call to unsafe function
|
22 | 59 | |
|
23 | 60 | = note: consult the function's documentation for information on how to avoid undefined behavior
|
24 | 61 |
|
25 | 62 | error: unnecessary `unsafe` block
|
26 |
| - --> $DIR/unsafe-env.rs:26:5 |
| 63 | + --> $DIR/unsafe-env.rs:36:5 |
27 | 64 | |
|
28 | 65 | LL | unsafe {
|
29 | 66 | | ^^^^^^ unnecessary `unsafe` block
|
30 | 67 | |
|
31 | 68 | note: the lint level is defined here
|
32 |
| - --> $DIR/unsafe-env.rs:11:8 |
| 69 | + --> $DIR/unsafe-env.rs:21:8 |
33 | 70 | |
|
34 | 71 | LL | #[deny(unused_unsafe)]
|
35 | 72 | | ^^^^^^^^^^^^^
|
36 | 73 |
|
37 |
| -error: aborting due to 4 previous errors |
| 74 | +error: aborting due to 7 previous errors |
38 | 75 |
|
39 | 76 | For more information about this error, try `rustc --explain E0133`.
|
0 commit comments