Skip to content

Commit e64177c

Browse files
authored
Rollup merge of #102615 - Nilstrieb:there-are-many-error-codes, r=compiler-errors
Cleanup some error code explanations E0045: Use a stable non-C ABI instead E0092: Use an atomic intrinsic that actually exists E0161: Don't use box_syntax E0579: Format ranges in the rustfmt style E0622: Use the rustfmt style E0743: Remove feature gate as it's not needed
2 parents aa076d6 + 1df0a18 commit e64177c

File tree

6 files changed

+7
-14
lines changed

6 files changed

+7
-14
lines changed

compiler/rustc_error_codes/src/error_codes/E0045.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ Variadic parameters have been used on a non-C ABI function.
33
Erroneous code example:
44

55
```compile_fail,E0045
6-
#![feature(unboxed_closures)]
7-
8-
extern "rust-call" {
6+
extern "Rust" {
97
fn foo(x: u8, ...); // error!
108
}
119
```

compiler/rustc_error_codes/src/error_codes/E0092.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ functions are defined in `compiler/rustc_codegen_llvm/src/intrinsic.rs` and in
1919
#![feature(intrinsics)]
2020
2121
extern "rust-intrinsic" {
22-
fn atomic_fence(); // ok!
22+
fn atomic_fence_seqcst(); // ok!
2323
}
2424
```

compiler/rustc_error_codes/src/error_codes/E0161.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ A value was moved whose size was not known at compile time.
33
Erroneous code example:
44

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

2928
```
30-
#![feature(box_syntax)]
31-
3229
trait Bar {
3330
fn f(&self);
3431
}
@@ -38,7 +35,7 @@ impl Bar for i32 {
3835
}
3936
4037
fn main() {
41-
let b: Box<dyn Bar> = box (0 as i32);
38+
let b: Box<dyn Bar> = Box::new(0i32);
4239
b.f();
4340
// ok!
4441
}

compiler/rustc_error_codes/src/error_codes/E0579.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Erroneous code example:
88
fn main() {
99
match 5u32 {
1010
// This range is ok, albeit pointless.
11-
1 .. 2 => {}
11+
1..2 => {}
1212
// This range is empty, and the compiler can tell.
13-
5 .. 5 => {} // error!
13+
5..5 => {} // error!
1414
}
1515
}
1616
```

compiler/rustc_error_codes/src/error_codes/E0622.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Erroneous code example:
55
```compile_fail,E0622
66
#![feature(intrinsics)]
77
extern "rust-intrinsic" {
8-
pub static breakpoint : fn(); // error: intrinsic must be a function
8+
pub static breakpoint: fn(); // error: intrinsic must be a function
99
}
1010
1111
fn main() { unsafe { breakpoint(); } }

compiler/rustc_error_codes/src/error_codes/E0743.md

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ The C-variadic type `...` has been nested inside another type.
33
Erroneous code example:
44

55
```compile_fail,E0743
6-
#![feature(c_variadic)]
7-
86
fn foo2(x: u8, y: &...) {} // error!
97
```
108

0 commit comments

Comments
 (0)