diff options
Diffstat (limited to 'crates/ide_diagnostics/src/handlers/missing_unsafe.rs')
-rw-r--r-- | crates/ide_diagnostics/src/handlers/missing_unsafe.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ide_diagnostics/src/handlers/missing_unsafe.rs b/crates/ide_diagnostics/src/handlers/missing_unsafe.rs index 62d8687ba..7acd9228a 100644 --- a/crates/ide_diagnostics/src/handlers/missing_unsafe.rs +++ b/crates/ide_diagnostics/src/handlers/missing_unsafe.rs | |||
@@ -23,7 +23,7 @@ fn main() { | |||
23 | let x = &5 as *const usize; | 23 | let x = &5 as *const usize; |
24 | unsafe { let y = *x; } | 24 | unsafe { let y = *x; } |
25 | let z = *x; | 25 | let z = *x; |
26 | } //^^ this operation is unsafe and requires an unsafe function or block | 26 | } //^^ error: this operation is unsafe and requires an unsafe function or block |
27 | "#, | 27 | "#, |
28 | ) | 28 | ) |
29 | } | 29 | } |
@@ -48,9 +48,9 @@ unsafe fn unsafe_fn() { | |||
48 | 48 | ||
49 | fn main() { | 49 | fn main() { |
50 | unsafe_fn(); | 50 | unsafe_fn(); |
51 | //^^^^^^^^^^^ this operation is unsafe and requires an unsafe function or block | 51 | //^^^^^^^^^^^ error: this operation is unsafe and requires an unsafe function or block |
52 | HasUnsafe.unsafe_fn(); | 52 | HasUnsafe.unsafe_fn(); |
53 | //^^^^^^^^^^^^^^^^^^^^^ this operation is unsafe and requires an unsafe function or block | 53 | //^^^^^^^^^^^^^^^^^^^^^ error: this operation is unsafe and requires an unsafe function or block |
54 | unsafe { | 54 | unsafe { |
55 | unsafe_fn(); | 55 | unsafe_fn(); |
56 | HasUnsafe.unsafe_fn(); | 56 | HasUnsafe.unsafe_fn(); |
@@ -72,7 +72,7 @@ static mut STATIC_MUT: Ty = Ty { a: 0 }; | |||
72 | 72 | ||
73 | fn main() { | 73 | fn main() { |
74 | let x = STATIC_MUT.a; | 74 | let x = STATIC_MUT.a; |
75 | //^^^^^^^^^^ this operation is unsafe and requires an unsafe function or block | 75 | //^^^^^^^^^^ error: this operation is unsafe and requires an unsafe function or block |
76 | unsafe { | 76 | unsafe { |
77 | let x = STATIC_MUT.a; | 77 | let x = STATIC_MUT.a; |
78 | } | 78 | } |
@@ -93,7 +93,7 @@ extern "rust-intrinsic" { | |||
93 | fn main() { | 93 | fn main() { |
94 | let _ = bitreverse(12); | 94 | let _ = bitreverse(12); |
95 | let _ = floorf32(12.0); | 95 | let _ = floorf32(12.0); |
96 | //^^^^^^^^^^^^^^ this operation is unsafe and requires an unsafe function or block | 96 | //^^^^^^^^^^^^^^ error: this operation is unsafe and requires an unsafe function or block |
97 | } | 97 | } |
98 | "#, | 98 | "#, |
99 | ); | 99 | ); |