Skip to content

Commit

Permalink
Rollup merge of #70231 - aDotInTheVoid:E0224, r=Dylan-DPC
Browse files Browse the repository at this point in the history
Add explanation message for E0224

Addresses some of #61137
  • Loading branch information
Dylan-DPC committed Mar 21, 2020
2 parents 6e9720d + 97aa270 commit 4b5ca6e
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/librustc_error_codes/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ E0220: include_str!("./error_codes/E0220.md"),
E0221: include_str!("./error_codes/E0221.md"),
E0222: include_str!("./error_codes/E0222.md"),
E0223: include_str!("./error_codes/E0223.md"),
E0224: include_str!("./error_codes/E0224.md"),
E0225: include_str!("./error_codes/E0225.md"),
E0229: include_str!("./error_codes/E0229.md"),
E0230: include_str!("./error_codes/E0230.md"),
Expand Down Expand Up @@ -469,7 +470,6 @@ E0748: include_str!("./error_codes/E0748.md"),
// E0217, // ambiguous associated type, defined in multiple supertraits
// E0218, // no associated type defined
// E0219, // associated type defined in higher-ranked supertrait
E0224, // at least one non-builtin train is required for an object type
E0226, // only a single explicit lifetime bound is permitted
E0227, // ambiguous lifetime bound, explicit lifetime bound required
E0228, // explicit lifetime bound required
Expand Down
15 changes: 15 additions & 0 deletions src/librustc_error_codes/error_codes/E0224.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
A trait object was declaired with no traits.

Erroneous code example:

```compile_fail,E0224
type Foo = dyn 'static +;
```

Rust does not currently support this.

To solve ensure the the trait object has at least one trait:

```
type Foo = dyn 'static + Copy;
```
1 change: 1 addition & 0 deletions src/test/ui/parser/issue-68890-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ LL | type X<'a> = (?'a) +;

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0224`.
1 change: 1 addition & 0 deletions src/test/ui/parser/macro/trait-object-macro-matcher.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ LL | m!('static);

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0224`.
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ LL | type _T1 = dyn _2;

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0224`.
3 changes: 2 additions & 1 deletion src/test/ui/traits/trait-object-macro-matcher.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ LL | m!(dyn Copy + Send + 'static);

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0038`.
Some errors have detailed explanations: E0038, E0224.
For more information about an error, try `rustc --explain E0038`.
1 change: 1 addition & 0 deletions src/test/ui/traits/trait-object-vs-lifetime-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ LL | dyn 'static +: 'static + Copy,

error: aborting due to previous error

For more information about this error, try `rustc --explain E0224`.
2 changes: 1 addition & 1 deletion src/test/ui/traits/trait-object-vs-lifetime.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ LL | let _: S<dyn 'static +, 'static>;

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0107, E0747.
Some errors have detailed explanations: E0107, E0224, E0747.
For more information about an error, try `rustc --explain E0107`.
1 change: 1 addition & 0 deletions src/test/ui/traits/wf-trait-object-only-maybe-bound.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ LL | type _0 = dyn ?Sized;

error: aborting due to 2 previous errors

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

0 comments on commit 4b5ca6e

Please sign in to comment.