Skip to content

Commit 21d2637

Browse files
authored
Rollup merge of #70231 - aDotInTheVoid:E0224, r=Dylan-DPC
Add explanation message for E0224 Addresses some of #61137
2 parents bb04720 + 97aa270 commit 21d2637

9 files changed

+24
-3
lines changed

src/librustc_error_codes/error_codes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ E0220: include_str!("./error_codes/E0220.md"),
118118
E0221: include_str!("./error_codes/E0221.md"),
119119
E0222: include_str!("./error_codes/E0222.md"),
120120
E0223: include_str!("./error_codes/E0223.md"),
121+
E0224: include_str!("./error_codes/E0224.md"),
121122
E0225: include_str!("./error_codes/E0225.md"),
122123
E0229: include_str!("./error_codes/E0229.md"),
123124
E0230: include_str!("./error_codes/E0230.md"),
@@ -469,7 +470,6 @@ E0748: include_str!("./error_codes/E0748.md"),
469470
// E0217, // ambiguous associated type, defined in multiple supertraits
470471
// E0218, // no associated type defined
471472
// E0219, // associated type defined in higher-ranked supertrait
472-
E0224, // at least one non-builtin train is required for an object type
473473
E0226, // only a single explicit lifetime bound is permitted
474474
E0227, // ambiguous lifetime bound, explicit lifetime bound required
475475
E0228, // explicit lifetime bound required
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
A trait object was declaired with no traits.
2+
3+
Erroneous code example:
4+
5+
```compile_fail,E0224
6+
type Foo = dyn 'static +;
7+
```
8+
9+
Rust does not currently support this.
10+
11+
To solve ensure the the trait object has at least one trait:
12+
13+
```
14+
type Foo = dyn 'static + Copy;
15+
```

src/test/ui/parser/issue-68890-2.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ LL | type X<'a> = (?'a) +;
2020

2121
error: aborting due to 2 previous errors
2222

23+
For more information about this error, try `rustc --explain E0224`.

src/test/ui/parser/macro/trait-object-macro-matcher.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ LL | m!('static);
2020

2121
error: aborting due to 2 previous errors
2222

23+
For more information about this error, try `rustc --explain E0224`.

src/test/ui/traits/trait-alias/trait-alias-only-maybe-bound.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ LL | type _T1 = dyn _2;
1212

1313
error: aborting due to 2 previous errors
1414

15+
For more information about this error, try `rustc --explain E0224`.

src/test/ui/traits/trait-object-macro-matcher.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ LL | m!(dyn Copy + Send + 'static);
1414

1515
error: aborting due to 2 previous errors
1616

17-
For more information about this error, try `rustc --explain E0038`.
17+
Some errors have detailed explanations: E0038, E0224.
18+
For more information about an error, try `rustc --explain E0038`.

src/test/ui/traits/trait-object-vs-lifetime-2.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ LL | dyn 'static +: 'static + Copy,
66

77
error: aborting due to previous error
88

9+
For more information about this error, try `rustc --explain E0224`.

src/test/ui/traits/trait-object-vs-lifetime.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ LL | let _: S<dyn 'static +, 'static>;
3232

3333
error: aborting due to 5 previous errors
3434

35-
Some errors have detailed explanations: E0107, E0747.
35+
Some errors have detailed explanations: E0107, E0224, E0747.
3636
For more information about an error, try `rustc --explain E0107`.

src/test/ui/traits/wf-trait-object-only-maybe-bound.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ LL | type _0 = dyn ?Sized;
1212

1313
error: aborting due to 2 previous errors
1414

15+
For more information about this error, try `rustc --explain E0224`.

0 commit comments

Comments
 (0)