fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
4.0 KiB99 linesraw
1error: call to unsafe function is unsafe and requires unsafe block (error E0133)
2  --> $DIR/wrapping-unsafe-block-sugg.rs:12:5
3   |
4LL |     unsf();
5   |     ^^^^^^ call to unsafe function
6   |
7   = note: consult the function's documentation for information on how to avoid undefined behavior
8note: an unsafe function restricts its caller, but its body is safe by default
9  --> $DIR/wrapping-unsafe-block-sugg.rs:10:1
10   |
11LL | pub unsafe fn foo() {
12   | ^^^^^^^^^^^^^^^^^^^
13note: the lint level is defined here
14  --> $DIR/wrapping-unsafe-block-sugg.rs:4:9
15   |
16LL | #![deny(unsafe_op_in_unsafe_fn)]
17   |         ^^^^^^^^^^^^^^^^^^^^^^
18
19error: call to unsafe function is unsafe and requires unsafe block (error E0133)
20  --> $DIR/wrapping-unsafe-block-sugg.rs:15:5
21   |
22LL |     unsf();
23   |     ^^^^^^ call to unsafe function
24   |
25   = note: consult the function's documentation for information on how to avoid undefined behavior
26
27error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
28  --> $DIR/wrapping-unsafe-block-sugg.rs:22:13
29   |
30LL |     let y = *x;
31   |             ^^ dereference of raw pointer
32   |
33   = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
34note: an unsafe function restricts its caller, but its body is safe by default
35  --> $DIR/wrapping-unsafe-block-sugg.rs:20:1
36   |
37LL | pub unsafe fn bar(x: *const i32) -> i32 {
38   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39
40error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
41  --> $DIR/wrapping-unsafe-block-sugg.rs:25:9
42   |
43LL |     y + *x
44   |         ^^ dereference of raw pointer
45   |
46   = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
47
48error: use of mutable static is unsafe and requires unsafe block (error E0133)
49  --> $DIR/wrapping-unsafe-block-sugg.rs:33:13
50   |
51LL |     let y = BAZ;
52   |             ^^^ use of mutable static
53   |
54   = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
55note: an unsafe function restricts its caller, but its body is safe by default
56  --> $DIR/wrapping-unsafe-block-sugg.rs:31:1
57   |
58LL | pub unsafe fn baz() -> i32 {
59   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
60
61error: use of mutable static is unsafe and requires unsafe block (error E0133)
62  --> $DIR/wrapping-unsafe-block-sugg.rs:36:9
63   |
64LL |     y + BAZ
65   |         ^^^ use of mutable static
66   |
67   = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
68
69error: call to unsafe function is unsafe and requires unsafe block (error E0133)
70  --> $DIR/wrapping-unsafe-block-sugg.rs:41:36
71   |
72LL | macro_rules! unsafe_macro { () => (unsf()) }
73   |                                    ^^^^^^ call to unsafe function
74...
75LL |     unsafe_macro!();
76   |     --------------- in this macro invocation
77   |
78   = note: consult the function's documentation for information on how to avoid undefined behavior
79note: an unsafe function restricts its caller, but its body is safe by default
80  --> $DIR/wrapping-unsafe-block-sugg.rs:49:1
81   |
82LL | pub unsafe fn unsafe_in_macro() {
83   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84   = note: this error originates in the macro `unsafe_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
85
86error: call to unsafe function is unsafe and requires unsafe block (error E0133)
87  --> $DIR/wrapping-unsafe-block-sugg.rs:41:36
88   |
89LL | macro_rules! unsafe_macro { () => (unsf()) }
90   |                                    ^^^^^^ call to unsafe function
91...
92LL |     unsafe_macro!();
93   |     --------------- in this macro invocation
94   |
95   = note: consult the function's documentation for information on how to avoid undefined behavior
96   = note: this error originates in the macro `unsafe_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
97
98error: aborting due to 8 previous errors
99