summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr
blob: fd58e1b1ebe37908ac070d9c28c6168a85027ee4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
error: call to unsafe function is unsafe and requires unsafe block (error E0133)
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:12:5
   |
LL |     unsf();
   |     ^^^^^^ call to unsafe function
   |
note: the lint level is defined here
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:4:9
   |
LL | #![deny(unsafe_op_in_unsafe_fn)]
   |         ^^^^^^^^^^^^^^^^^^^^^^
   = note: consult the function's documentation for information on how to avoid undefined behavior

error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:15:5
   |
LL |     *PTR;
   |     ^^^^ dereference of raw pointer
   |
   = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior

error: use of mutable static is unsafe and requires unsafe block (error E0133)
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:17:5
   |
LL |     VOID = ();
   |     ^^^^^^^^^ use of mutable static
   |
   = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior

error: unnecessary `unsafe` block
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:20:5
   |
LL |     unsafe {}
   |     ^^^^^^ unnecessary `unsafe` block
   |
note: the lint level is defined here
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:5:9
   |
LL | #![deny(unused_unsafe)]
   |         ^^^^^^^^^^^^^

error: call to unsafe function is unsafe and requires unsafe block (error E0133)
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:28:5
   |
LL |     unsf();
   |     ^^^^^^ call to unsafe function
   |
note: the lint level is defined here
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:26:8
   |
LL | #[deny(warnings)]
   |        ^^^^^^^^
   = note: `#[deny(unsafe_op_in_unsafe_fn)]` implied by `#[deny(warnings)]`
   = note: consult the function's documentation for information on how to avoid undefined behavior

error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:31:5
   |
LL |     *PTR;
   |     ^^^^ dereference of raw pointer
   |
   = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior

error: use of mutable static is unsafe and requires unsafe block (error E0133)
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:33:5
   |
LL |     VOID = ();
   |     ^^^^^^^^^ use of mutable static
   |
   = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior

error: unnecessary `unsafe` block
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:35:5
   |
LL |     unsafe {}
   |     ^^^^^^ unnecessary `unsafe` block

error: unnecessary `unsafe` block
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:49:5
   |
LL |     unsafe { unsafe { unsf() } }
   |     ^^^^^^ unnecessary `unsafe` block

error: unnecessary `unsafe` block
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:60:5
   |
LL | unsafe fn allow_level() {
   | ----------------------- because it's nested under this `unsafe` fn
...
LL |     unsafe { unsf() }
   |     ^^^^^^ unnecessary `unsafe` block
   |
   = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
note: the lint level is defined here
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:53:9
   |
LL | #[allow(unsafe_op_in_unsafe_fn)]
   |         ^^^^^^^^^^^^^^^^^^^^^^

error: unnecessary `unsafe` block
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:72:9
   |
LL | unsafe fn nested_allow_level() {
   | ------------------------------ because it's nested under this `unsafe` fn
...
LL |         unsafe { unsf() }
   |         ^^^^^^ unnecessary `unsafe` block
   |
   = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
note: the lint level is defined here
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:65:13
   |
LL |     #[allow(unsafe_op_in_unsafe_fn)]
   |             ^^^^^^^^^^^^^^^^^^^^^^

error[E0133]: call to unsafe function is unsafe and requires unsafe block
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:78:5
   |
LL |     unsf();
   |     ^^^^^^ call to unsafe function
   |
   = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
  --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:83:9
   |
LL |         unsf();
   |         ^^^^^^ call to unsafe function
   |
   = note: consult the function's documentation for information on how to avoid undefined behavior

error: aborting due to 13 previous errors

For more information about this error, try `rustc --explain E0133`.