@@ -27,78 +27,96 @@ LL | VOID = ();
27
27
|
28
28
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
29
29
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
+
30
42
error: 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
32
44
|
33
45
LL | unsf();
34
46
| ^^^^^^ call to unsafe function
35
47
|
36
48
note: 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
38
50
|
39
51
LL | #[deny(warnings)]
40
52
| ^^^^^^^^
41
53
= note: `#[deny(unsafe_op_in_unsafe_fn)]` implied by `#[deny(warnings)]`
42
54
= note: consult the function's documentation for information on how to avoid undefined behavior
43
55
44
56
error: 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
46
58
|
47
59
LL | *PTR;
48
60
| ^^^^ dereference of raw pointer
49
61
|
50
62
= note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
51
63
52
64
error: 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
54
66
|
55
67
LL | VOID = ();
56
68
| ^^^^^^^^^ use of mutable static
57
69
|
58
70
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
59
71
60
72
error: 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
62
80
|
63
81
LL | unsafe { unsafe { unsf() } }
64
82
| ------ ^^^^^^ unnecessary `unsafe` block
65
83
| |
66
84
| 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
- | ^^^^^^^^^^^^^
73
85
74
86
error: 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
76
88
|
89
+ LL | unsafe fn allow_level() {
90
+ | ----------------------- because it's nested under this `unsafe` fn
91
+ ...
77
92
LL | unsafe { unsf() }
78
93
| ^^^^^^ unnecessary `unsafe` block
79
94
80
95
error: 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
82
97
|
98
+ LL | unsafe fn nested_allow_level() {
99
+ | ------------------------------ because it's nested under this `unsafe` fn
100
+ ...
83
101
LL | unsafe { unsf() }
84
102
| ^^^^^^ unnecessary `unsafe` block
85
103
86
104
error[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
88
106
|
89
107
LL | unsf();
90
108
| ^^^^^^ call to unsafe function
91
109
|
92
110
= note: consult the function's documentation for information on how to avoid undefined behavior
93
111
94
112
error[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
96
114
|
97
115
LL | unsf();
98
116
| ^^^^^^ call to unsafe function
99
117
|
100
118
= note: consult the function's documentation for information on how to avoid undefined behavior
101
119
102
- error: aborting due to 11 previous errors
120
+ error: aborting due to 13 previous errors
103
121
104
122
For more information about this error, try `rustc --explain E0133`.
0 commit comments