@@ -27,78 +27,96 @@ LL | VOID = ();
2727 |
2828 = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
2929
30+ error: unnecessary `unsafe` block
31+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:17:5
32+ |
33+ LL | unsafe {}
34+ | ^^^^^^ unnecessary `unsafe` block
35+ |
36+ note: the lint level is defined here
37+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:3:9
38+ |
39+ LL | #![deny(unused_unsafe)]
40+ | ^^^^^^^^^^^^^
41+
3042error: call to unsafe function is unsafe and requires unsafe block (error E0133)
31- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:22 :5
43+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:25 :5
3244 |
3345LL | unsf();
3446 | ^^^^^^ call to unsafe function
3547 |
3648note: the lint level is defined here
37- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:20 :8
49+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:23 :8
3850 |
3951LL | #[deny(warnings)]
4052 | ^^^^^^^^
4153 = note: `#[deny(unsafe_op_in_unsafe_fn)]` implied by `#[deny(warnings)]`
4254 = note: consult the function's documentation for information on how to avoid undefined behavior
4355
4456error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
45- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:24 :5
57+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:27 :5
4658 |
4759LL | *PTR;
4860 | ^^^^ dereference of raw pointer
4961 |
5062 = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
5163
5264error: use of mutable static is unsafe and requires unsafe block (error E0133)
53- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:26 :5
65+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:29 :5
5466 |
5567LL | VOID = ();
5668 | ^^^^^^^^^ use of mutable static
5769 |
5870 = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
5971
6072error: unnecessary `unsafe` block
61- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:40:14
73+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:31:5
74+ |
75+ LL | unsafe {}
76+ | ^^^^^^ unnecessary `unsafe` block
77+
78+ error: unnecessary `unsafe` block
79+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:45:14
6280 |
6381LL | unsafe { unsafe { unsf() } }
6482 | ------ ^^^^^^ unnecessary `unsafe` block
6583 | |
6684 | because it's nested under this `unsafe` block
67- |
68- note: the lint level is defined here
69- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:3:9
70- |
71- LL | #![deny(unused_unsafe)]
72- | ^^^^^^^^^^^^^
7385
7486error: unnecessary `unsafe` block
75- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:51 :5
87+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:56 :5
7688 |
89+ LL | unsafe fn allow_level() {
90+ | ----------------------- because it's nested under this `unsafe` fn
91+ ...
7792LL | unsafe { unsf() }
7893 | ^^^^^^ unnecessary `unsafe` block
7994
8095error: unnecessary `unsafe` block
81- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:63 :9
96+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:68 :9
8297 |
98+ LL | unsafe fn nested_allow_level() {
99+ | ------------------------------ because it's nested under this `unsafe` fn
100+ ...
83101LL | unsafe { unsf() }
84102 | ^^^^^^ unnecessary `unsafe` block
85103
86104error[E0133]: call to unsafe function is unsafe and requires unsafe block
87- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:69 :5
105+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:74 :5
88106 |
89107LL | unsf();
90108 | ^^^^^^ call to unsafe function
91109 |
92110 = note: consult the function's documentation for information on how to avoid undefined behavior
93111
94112error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
95- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:73 :9
113+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:78 :9
96114 |
97115LL | unsf();
98116 | ^^^^^^ call to unsafe function
99117 |
100118 = note: consult the function's documentation for information on how to avoid undefined behavior
101119
102- error: aborting due to 11 previous errors
120+ error: aborting due to 13 previous errors
103121
104122For more information about this error, try `rustc --explain E0133`.
0 commit comments