File: wrapping-unsafe-block-sugg.stderr

package info (click to toggle)
rustc 1.87.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 925,564 kB
  • sloc: xml: 158,127; python: 36,039; javascript: 19,761; sh: 19,737; cpp: 18,981; ansic: 13,133; asm: 4,376; makefile: 710; perl: 29; lisp: 28; ruby: 19; sql: 11
file content (108 lines) | stat: -rw-r--r-- 5,121 bytes parent folder | download | duplicates (12)
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
error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block
  --> $DIR/wrapping-unsafe-block-sugg.rs:13:5
   |
LL |     unsf();
   |     ^^^^^^ call to unsafe function
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
   = note: consult the function's documentation for information on how to avoid undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
  --> $DIR/wrapping-unsafe-block-sugg.rs:11:1
   |
LL | pub unsafe fn foo() {
   | ^^^^^^^^^^^^^^^^^^^
note: the lint level is defined here
  --> $DIR/wrapping-unsafe-block-sugg.rs:4:9
   |
LL | #![deny(unsafe_op_in_unsafe_fn)]
   |         ^^^^^^^^^^^^^^^^^^^^^^

error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block
  --> $DIR/wrapping-unsafe-block-sugg.rs:17:5
   |
LL |     unsf();
   |     ^^^^^^ call to unsafe function
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
   = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: dereference of raw pointer is unsafe and requires unsafe block
  --> $DIR/wrapping-unsafe-block-sugg.rs:25:13
   |
LL |     let y = *x;
   |             ^^ dereference of raw pointer
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
   = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
  --> $DIR/wrapping-unsafe-block-sugg.rs:23:1
   |
LL | pub unsafe fn bar(x: *const i32) -> i32 {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0133]: dereference of raw pointer is unsafe and requires unsafe block
  --> $DIR/wrapping-unsafe-block-sugg.rs:29:9
   |
LL |     y + *x
   |         ^^ dereference of raw pointer
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
   = 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[E0133]: use of mutable static is unsafe and requires unsafe block
  --> $DIR/wrapping-unsafe-block-sugg.rs:38:13
   |
LL |     let y = BAZ;
   |             ^^^ use of mutable static
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
   = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
  --> $DIR/wrapping-unsafe-block-sugg.rs:36:1
   |
LL | pub unsafe fn baz() -> i32 {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0133]: use of mutable static is unsafe and requires unsafe block
  --> $DIR/wrapping-unsafe-block-sugg.rs:42:9
   |
LL |     y + BAZ
   |         ^^^ use of mutable static
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
   = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior

error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block
  --> $DIR/wrapping-unsafe-block-sugg.rs:48:36
   |
LL | macro_rules! unsafe_macro { () => (unsf()) }
   |                                    ^^^^^^ call to unsafe function
...
LL |     unsafe_macro!();
   |     --------------- in this macro invocation
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
   = note: consult the function's documentation for information on how to avoid undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
  --> $DIR/wrapping-unsafe-block-sugg.rs:58:1
   |
LL | pub unsafe fn unsafe_in_macro() {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: this error originates in the macro `unsafe_macro` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block
  --> $DIR/wrapping-unsafe-block-sugg.rs:48:36
   |
LL | macro_rules! unsafe_macro { () => (unsf()) }
   |                                    ^^^^^^ call to unsafe function
...
LL |     unsafe_macro!();
   |     --------------- in this macro invocation
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
   = note: consult the function's documentation for information on how to avoid undefined behavior
   = note: this error originates in the macro `unsafe_macro` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 8 previous errors

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