Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/librustc/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,18 @@ type X = u32; // ok!
"##,

E0133: r##"
Unsafe code was used outside of an unsafe function or block.

Erroneous code example:

```compile_fail
unsafe fn f() { return; } // This is the unsafe code

fn main() {
f(); // error: call to unsafe function requires unsafe function or block
}
```

Using unsafe functionality is potentially dangerous and disallowed by safety
checks. Examples:

Expand All @@ -378,7 +390,7 @@ unsafe instructions with an `unsafe` block. For instance:
unsafe fn f() { return; }

fn main() {
unsafe { f(); }
unsafe { f(); } // ok!
}
```

Expand Down