Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup some error code explanations #102615

Merged
merged 1 commit into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions compiler/rustc_error_codes/src/error_codes/E0045.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ Variadic parameters have been used on a non-C ABI function.
Erroneous code example:

```compile_fail,E0045
#![feature(unboxed_closures)]
extern "rust-call" {
extern "Rust" {
fn foo(x: u8, ...); // error!
}
```
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes/E0092.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ functions are defined in `compiler/rustc_codegen_llvm/src/intrinsic.rs` and in
#![feature(intrinsics)]
extern "rust-intrinsic" {
fn atomic_fence(); // ok!
fn atomic_fence_seqcst(); // ok!
}
```
7 changes: 2 additions & 5 deletions compiler/rustc_error_codes/src/error_codes/E0161.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A value was moved whose size was not known at compile time.
Erroneous code example:

```compile_fail,E0161
#![feature(box_syntax)]
trait Bar {
fn f(self);
}
Expand All @@ -13,7 +12,7 @@ impl Bar for i32 {
}
fn main() {
let b: Box<dyn Bar> = box (0 as i32);
let b: Box<dyn Bar> = Box::new(0i32);
b.f();
// error: cannot move a value of type dyn Bar: the size of dyn Bar cannot
// be statically determined
Expand All @@ -27,8 +26,6 @@ either `&x` or `&mut x`. Since a reference has a fixed size, this lets you move
it around as usual. Example:

```
#![feature(box_syntax)]
trait Bar {
fn f(&self);
}
Expand All @@ -38,7 +35,7 @@ impl Bar for i32 {
}
fn main() {
let b: Box<dyn Bar> = box (0 as i32);
let b: Box<dyn Bar> = Box::new(0i32);
b.f();
// ok!
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_error_codes/src/error_codes/E0579.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Erroneous code example:
fn main() {
match 5u32 {
// This range is ok, albeit pointless.
1 .. 2 => {}
1..2 => {}
// This range is empty, and the compiler can tell.
5 .. 5 => {} // error!
5..5 => {} // error!
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes/E0622.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Erroneous code example:
```compile_fail,E0622
#![feature(intrinsics)]
extern "rust-intrinsic" {
pub static breakpoint : fn(); // error: intrinsic must be a function
pub static breakpoint: fn(); // error: intrinsic must be a function
}
fn main() { unsafe { breakpoint(); } }
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_error_codes/src/error_codes/E0743.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ The C-variadic type `...` has been nested inside another type.
Erroneous code example:

```compile_fail,E0743
#![feature(c_variadic)]
fn foo2(x: u8, y: &...) {} // error!
```

Expand Down