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