summary refs log tree commit diff
path: root/tests/ui/unsafe
diff options
context:
space:
mode:
authorWim Looman <git@nemo157.com>2023-05-27 22:19:09 +0200
committerWim Looman <git@nemo157.com>2023-06-13 15:48:55 +0200
commit62a712a8bbb29a5d2f4e82b74d1ee5aa0490a5a3 (patch)
treec8e5267b5a1e3752544164a20b15ff3d7d67d5b3 /tests/ui/unsafe
parentaca61b2c07f2f7b644ca000385473af9de2d5f77 (diff)
downloadrust-62a712a8bbb29a5d2f4e82b74d1ee5aa0490a5a3.tar.gz
rust-62a712a8bbb29a5d2f4e82b74d1ee5aa0490a5a3.zip
Hide suggestion to wrap function in unsafe block
Diffstat (limited to 'tests/ui/unsafe')
-rw-r--r--tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr16
-rw-r--r--tests/ui/unsafe/wrapping-unsafe-block-sugg.stderr21
2 files changed, 0 insertions, 37 deletions
diff --git a/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr b/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr
index 2333f710c40..6f005fe8958 100644
--- a/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr
+++ b/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr
@@ -10,14 +10,6 @@ note: the lint level is defined here
    |
 LL | #![deny(unsafe_op_in_unsafe_fn)]
    |         ^^^^^^^^^^^^^^^^^^^^^^
-help: consider wrapping the function body in an unsafe block
-   |
-LL ~ unsafe fn deny_level() { unsafe {
-LL |     unsf();
- ...
-LL |
-LL ~ }}
-   |
 
 error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
   --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:15:5
@@ -60,14 +52,6 @@ note: the lint level is defined here
 LL | #[deny(warnings)]
    |        ^^^^^^^^
    = note: `#[deny(unsafe_op_in_unsafe_fn)]` implied by `#[deny(warnings)]`
-help: consider wrapping the function body in an unsafe block
-   |
-LL ~ unsafe fn warning_level() { unsafe {
-LL |     unsf();
- ...
-LL |
-LL ~ }}
-   |
 
 error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
   --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:31:5
diff --git a/tests/ui/unsafe/wrapping-unsafe-block-sugg.stderr b/tests/ui/unsafe/wrapping-unsafe-block-sugg.stderr
index b05d87069ab..b22c5b74b56 100644
--- a/tests/ui/unsafe/wrapping-unsafe-block-sugg.stderr
+++ b/tests/ui/unsafe/wrapping-unsafe-block-sugg.stderr
@@ -10,13 +10,6 @@ note: the lint level is defined here
    |
 LL | #![deny(unsafe_op_in_unsafe_fn)]
    |         ^^^^^^^^^^^^^^^^^^^^^^
-help: consider wrapping the function body in an unsafe block
-   |
-LL ~ pub unsafe fn foo() { unsafe {
-LL |     unsf();
-LL |     unsf();
-LL ~ }}
-   |
 
 error: call to unsafe function is unsafe and requires unsafe block (error E0133)
   --> $DIR/wrapping-unsafe-block-sugg.rs:9:5
@@ -33,13 +26,6 @@ LL |     let y = *x;
    |             ^^ 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
-help: consider wrapping the function body in an unsafe block
-   |
-LL ~ pub unsafe fn bar(x: *const i32) -> i32 { unsafe {
-LL |     let y = *x;
-LL |     y + *x
-LL ~ }}
-   |
 
 error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
   --> $DIR/wrapping-unsafe-block-sugg.rs:14:9
@@ -56,13 +42,6 @@ LL |     let y = BAZ;
    |             ^^^ use of mutable static
    |
    = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
-help: consider wrapping the function body in an unsafe block
-   |
-LL ~ pub unsafe fn baz() -> i32 { unsafe {
-LL |     let y = BAZ;
-LL |     y + BAZ
-LL ~ }}
-   |
 
 error: use of mutable static is unsafe and requires unsafe block (error E0133)
   --> $DIR/wrapping-unsafe-block-sugg.rs:20:9