summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr')
-rw-r--r--src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr122
1 files changed, 122 insertions, 0 deletions
diff --git a/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr b/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr
new file mode 100644
index 000000000..2ba6a7293
--- /dev/null
+++ b/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr
@@ -0,0 +1,122 @@
+error: call to unsafe function `unsf` is unsafe and requires unsafe block (error E0133)
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:12:5
+ |
+LL | unsf();
+ | ^^^^^^ call to unsafe function
+ |
+note: the lint level is defined here
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:4:9
+ |
+LL | #![deny(unsafe_op_in_unsafe_fn)]
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ = note: consult the function's documentation for information on how to avoid undefined behavior
+
+error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:15:5
+ |
+LL | *PTR;
+ | ^^^^ dereference of raw pointer
+ |
+ = 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: use of mutable static is unsafe and requires unsafe block (error E0133)
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:17:5
+ |
+LL | VOID = ();
+ | ^^^^ use of mutable static
+ |
+ = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
+
+error: unnecessary `unsafe` block
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:20:5
+ |
+LL | unsafe {}
+ | ^^^^^^ unnecessary `unsafe` block
+ |
+note: the lint level is defined here
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:5:9
+ |
+LL | #![deny(unused_unsafe)]
+ | ^^^^^^^^^^^^^
+
+error: call to unsafe function `unsf` is unsafe and requires unsafe block (error E0133)
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:28:5
+ |
+LL | unsf();
+ | ^^^^^^ call to unsafe function
+ |
+note: the lint level is defined here
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:26:8
+ |
+LL | #[deny(warnings)]
+ | ^^^^^^^^
+ = note: `#[deny(unsafe_op_in_unsafe_fn)]` implied by `#[deny(warnings)]`
+ = note: consult the function's documentation for information on how to avoid undefined behavior
+
+error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:31:5
+ |
+LL | *PTR;
+ | ^^^^ dereference of raw pointer
+ |
+ = 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: use of mutable static is unsafe and requires unsafe block (error E0133)
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:33:5
+ |
+LL | VOID = ();
+ | ^^^^ use of mutable static
+ |
+ = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
+
+error: unnecessary `unsafe` block
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:35:5
+ |
+LL | unsafe {}
+ | ^^^^^^ unnecessary `unsafe` block
+
+error: unnecessary `unsafe` block
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:49:14
+ |
+LL | unsafe { unsafe { unsf() } }
+ | ------ ^^^^^^ unnecessary `unsafe` block
+ | |
+ | because it's nested under this `unsafe` block
+
+error: unnecessary `unsafe` block
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:60:5
+ |
+LL | unsafe fn allow_level() {
+ | ----------------------- because it's nested under this `unsafe` fn
+...
+LL | unsafe { unsf() }
+ | ^^^^^^ unnecessary `unsafe` block
+
+error: unnecessary `unsafe` block
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:72:9
+ |
+LL | unsafe fn nested_allow_level() {
+ | ------------------------------ because it's nested under this `unsafe` fn
+...
+LL | unsafe { unsf() }
+ | ^^^^^^ unnecessary `unsafe` block
+
+error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:78:5
+ |
+LL | unsf();
+ | ^^^^^^ call to unsafe function
+ |
+ = note: consult the function's documentation for information on how to avoid undefined behavior
+
+error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe function or block
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:83:9
+ |
+LL | unsf();
+ | ^^^^^^ call to unsafe function
+ |
+ = note: consult the function's documentation for information on how to avoid undefined behavior
+
+error: aborting due to 13 previous errors
+
+For more information about this error, try `rustc --explain E0133`.