Skip to content

Commit 5c73be1

Browse files
Rollup merge of #67837 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC
Clean up err codes r? @Dylan-DPC
2 parents 1140cee + 062cd78 commit 5c73be1

File tree

3 files changed

+35
-13
lines changed

3 files changed

+35
-13
lines changed

src/librustc_error_codes/error_codes/E0136.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
A binary can only have one entry point, and by default that entry point is the
2-
function `main()`. If there are multiple such functions, please rename one.
1+
More than one `main` function was found.
32

43
Erroneous code example:
54

@@ -14,3 +13,7 @@ fn main() { // error!
1413
// ...
1514
}
1615
```
16+
17+
A binary can only have one entry point, and by default that entry point is the
18+
`main()` function. If there are multiple instances of this function, please
19+
rename one of them.

src/librustc_error_codes/error_codes/E0161.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
A value was moved. However, its size was not known at compile time, and only
2-
values of a known size can be moved.
1+
A value was moved whose size was not known at compile time.
32

43
Erroneous code example:
54

+29-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,44 @@
1-
This error means that an attempt was made to match a struct type enum
2-
variant as a non-struct type:
1+
Something which is neither a tuple struct nor a tuple variant was used as a
2+
pattern.
3+
4+
Erroneous code example:
35

46
```compile_fail,E0164
5-
enum Foo { B { i: u32 } }
7+
enum A {
8+
B,
9+
C,
10+
}
11+
12+
impl A {
13+
fn new() {}
14+
}
615
7-
fn bar(foo: Foo) -> u32 {
16+
fn bar(foo: A) {
817
match foo {
9-
Foo::B(i) => i, // error E0164
18+
A::new() => (), // error!
19+
_ => {}
1020
}
1121
}
1222
```
1323

14-
Try using `{}` instead:
24+
This error means that an attempt was made to match something which is neither a
25+
tuple struct nor a tuple variant. Only these two elements are allowed as a
26+
pattern:
1527

1628
```
17-
enum Foo { B { i: u32 } }
29+
enum A {
30+
B,
31+
C,
32+
}
33+
34+
impl A {
35+
fn new() {}
36+
}
1837
19-
fn bar(foo: Foo) -> u32 {
38+
fn bar(foo: A) {
2039
match foo {
21-
Foo::B{i} => i,
40+
A::B => (), // ok!
41+
_ => {}
2242
}
2343
}
2444
```

0 commit comments

Comments
 (0)