We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 075ea13 + c848ca1 commit 7475236Copy full SHA for 7475236
src/librustc/diagnostics.rs
@@ -366,6 +366,18 @@ type X = u32; // ok!
366
"##,
367
368
E0133: r##"
369
+Unsafe code was used outside of an unsafe function or block.
370
+
371
+Erroneous code example:
372
373
+```compile_fail
374
+unsafe fn f() { return; } // This is the unsafe code
375
376
+fn main() {
377
+ f(); // error: call to unsafe function requires unsafe function or block
378
+}
379
+```
380
381
Using unsafe functionality is potentially dangerous and disallowed by safety
382
checks. Examples:
383
@@ -380,7 +392,7 @@ unsafe instructions with an `unsafe` block. For instance:
392
unsafe fn f() { return; }
393
394
fn main() {
- unsafe { f(); }
395
+ unsafe { f(); } // ok!
384
396
}
385
397
```
386
398
0 commit comments