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