|
| 1 | +error: call to unsafe function is unsafe and requires unsafe block (error E0133) |
| 2 | + --> $DIR/wrapping-unsafe-block-sugg.rs:12:5 |
| 3 | + | |
| 4 | +LL | unsf(); |
| 5 | + | ^^^^^^ call to unsafe function |
| 6 | + | |
| 7 | + = note: consult the function's documentation for information on how to avoid undefined behavior |
| 8 | +note: an unsafe function restricts its caller, but its body is safe by default |
| 9 | + --> $DIR/wrapping-unsafe-block-sugg.rs:10:1 |
| 10 | + | |
| 11 | +LL | pub unsafe fn foo() { |
| 12 | + | ^^^^^^^^^^^^^^^^^^^ |
| 13 | +note: the lint level is defined here |
| 14 | + --> $DIR/wrapping-unsafe-block-sugg.rs:4:9 |
| 15 | + | |
| 16 | +LL | #![deny(unsafe_op_in_unsafe_fn)] |
| 17 | + | ^^^^^^^^^^^^^^^^^^^^^^ |
| 18 | + |
| 19 | +error: call to unsafe function is unsafe and requires unsafe block (error E0133) |
| 20 | + --> $DIR/wrapping-unsafe-block-sugg.rs:15:5 |
| 21 | + | |
| 22 | +LL | unsf(); |
| 23 | + | ^^^^^^ call to unsafe function |
| 24 | + | |
| 25 | + = note: consult the function's documentation for information on how to avoid undefined behavior |
| 26 | + |
| 27 | +error: dereference of raw pointer is unsafe and requires unsafe block (error E0133) |
| 28 | + --> $DIR/wrapping-unsafe-block-sugg.rs:22:13 |
| 29 | + | |
| 30 | +LL | 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 |
| 34 | +note: an unsafe function restricts its caller, but its body is safe by default |
| 35 | + --> $DIR/wrapping-unsafe-block-sugg.rs:20:1 |
| 36 | + | |
| 37 | +LL | pub unsafe fn bar(x: *const i32) -> i32 { |
| 38 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 39 | + |
| 40 | +error: dereference of raw pointer is unsafe and requires unsafe block (error E0133) |
| 41 | + --> $DIR/wrapping-unsafe-block-sugg.rs:25:9 |
| 42 | + | |
| 43 | +LL | 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 | + |
| 48 | +error: use of mutable static is unsafe and requires unsafe block (error E0133) |
| 49 | + --> $DIR/wrapping-unsafe-block-sugg.rs:33:13 |
| 50 | + | |
| 51 | +LL | 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 |
| 55 | +note: an unsafe function restricts its caller, but its body is safe by default |
| 56 | + --> $DIR/wrapping-unsafe-block-sugg.rs:31:1 |
| 57 | + | |
| 58 | +LL | pub unsafe fn baz() -> i32 { |
| 59 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 60 | + |
| 61 | +error: use of mutable static is unsafe and requires unsafe block (error E0133) |
| 62 | + --> $DIR/wrapping-unsafe-block-sugg.rs:36:9 |
| 63 | + | |
| 64 | +LL | 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 | + |
| 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 |
| 99 | + |
0 commit comments