summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/multiple_unsafe_ops_per_block.stderr
blob: badc284ec423e9b61b59efcbc31040f35822be2e (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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
error: this `unsafe` block contains 2 unsafe operations, expected only one
  --> $DIR/multiple_unsafe_ops_per_block.rs:36:5
   |
LL | /     unsafe {
LL | |         STATIC += 1;
LL | |         not_very_safe();
LL | |     }
   | |_____^
   |
note: modification of a mutable static occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:37:9
   |
LL |         STATIC += 1;
   |         ^^^^^^^^^^^
note: unsafe function call occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:38:9
   |
LL |         not_very_safe();
   |         ^^^^^^^^^^^^^^^
   = note: `-D clippy::multiple-unsafe-ops-per-block` implied by `-D warnings`

error: this `unsafe` block contains 2 unsafe operations, expected only one
  --> $DIR/multiple_unsafe_ops_per_block.rs:45:5
   |
LL | /     unsafe {
LL | |         drop(u.u);
LL | |         *raw_ptr();
LL | |     }
   | |_____^
   |
note: union field access occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:46:14
   |
LL |         drop(u.u);
   |              ^^^
note: raw pointer dereference occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:47:9
   |
LL |         *raw_ptr();
   |         ^^^^^^^^^^

error: this `unsafe` block contains 3 unsafe operations, expected only one
  --> $DIR/multiple_unsafe_ops_per_block.rs:52:5
   |
LL | /     unsafe {
LL | |         asm!("nop");
LL | |         sample.not_very_safe();
LL | |         STATIC = 0;
LL | |     }
   | |_____^
   |
note: inline assembly used here
  --> $DIR/multiple_unsafe_ops_per_block.rs:53:9
   |
LL |         asm!("nop");
   |         ^^^^^^^^^^^
note: unsafe method call occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:54:9
   |
LL |         sample.not_very_safe();
   |         ^^^^^^^^^^^^^^^^^^^^^^
note: modification of a mutable static occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:55:9
   |
LL |         STATIC = 0;
   |         ^^^^^^^^^^

error: this `unsafe` block contains 6 unsafe operations, expected only one
  --> $DIR/multiple_unsafe_ops_per_block.rs:61:5
   |
LL | /     unsafe {
LL | |         drop(u.u);
LL | |         drop(STATIC);
LL | |         sample.not_very_safe();
...  |
LL | |         asm!("nop");
LL | |     }
   | |_____^
   |
note: union field access occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:62:14
   |
LL |         drop(u.u);
   |              ^^^
note: access of a mutable static occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:63:14
   |
LL |         drop(STATIC);
   |              ^^^^^^
note: unsafe method call occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:64:9
   |
LL |         sample.not_very_safe();
   |         ^^^^^^^^^^^^^^^^^^^^^^
note: unsafe function call occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:65:9
   |
LL |         not_very_safe();
   |         ^^^^^^^^^^^^^^^
note: raw pointer dereference occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:66:9
   |
LL |         *raw_ptr();
   |         ^^^^^^^^^^
note: inline assembly used here
  --> $DIR/multiple_unsafe_ops_per_block.rs:67:9
   |
LL |         asm!("nop");
   |         ^^^^^^^^^^^

error: this `unsafe` block contains 2 unsafe operations, expected only one
  --> $DIR/multiple_unsafe_ops_per_block.rs:105:5
   |
LL |     unsafe { char::from_u32_unchecked(*ptr.cast::<u32>()) }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: unsafe function call occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:105:14
   |
LL |     unsafe { char::from_u32_unchecked(*ptr.cast::<u32>()) }
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: raw pointer dereference occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:105:39
   |
LL |     unsafe { char::from_u32_unchecked(*ptr.cast::<u32>()) }
   |                                       ^^^^^^^^^^^^^^^^^^

error: this `unsafe` block contains 2 unsafe operations, expected only one
  --> $DIR/multiple_unsafe_ops_per_block.rs:123:5
   |
LL | /     unsafe {
LL | |         x();
LL | |         x();
LL | |     }
   | |_____^
   |
note: unsafe function call occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:124:9
   |
LL |         x();
   |         ^^^
note: unsafe function call occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:125:9
   |
LL |         x();
   |         ^^^

error: this `unsafe` block contains 2 unsafe operations, expected only one
  --> $DIR/multiple_unsafe_ops_per_block.rs:134:9
   |
LL | /         unsafe {
LL | |             T::X();
LL | |             T::X();
LL | |         }
   | |_________^
   |
note: unsafe function call occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:135:13
   |
LL |             T::X();
   |             ^^^^^^
note: unsafe function call occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:136:13
   |
LL |             T::X();
   |             ^^^^^^

error: this `unsafe` block contains 2 unsafe operations, expected only one
  --> $DIR/multiple_unsafe_ops_per_block.rs:144:5
   |
LL | /     unsafe {
LL | |         x.0();
LL | |         x.0();
LL | |     }
   | |_____^
   |
note: unsafe function call occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:145:9
   |
LL |         x.0();
   |         ^^^^^
note: unsafe function call occurs here
  --> $DIR/multiple_unsafe_ops_per_block.rs:146:9
   |
LL |         x.0();
   |         ^^^^^

error: aborting due to 8 previous errors