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

Add explanation message for E0224 #70231

Merged
merged 1 commit into from
Mar 22, 2020
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
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`.