Skip to content

Add extended diagnostics for E0248 #27846

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

Merged
merged 1 commit into from
Aug 15, 2015
Merged
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
20 changes: 19 additions & 1 deletion src/librustc_typeck/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2365,6 +2365,25 @@ struct Bar<S, T> { x: Foo<S, T> }
```
"##,

E0248: r##"
This error indicates an attempt to use a value where a type is expected. For
example:

```
enum Foo {
Bar(u32)
}

fn do_something(x: Foo::Bar) { }
```

In this example, we're attempting to take a type of `Foo::Bar` in the
do_something function. This is not legal: `Foo::Bar` is a value of type `Foo`,
not a distinct static type. Likewise, it's not legal to attempt to
`impl Foo::Bar`: instead, you must `impl Foo` and then pattern match to specify
behaviour for specific enum variants.
"##,

E0249: r##"
This error indicates a constant expression for the array length was found, but
it was not an integer (signed or unsigned) expression.
Expand Down Expand Up @@ -2756,7 +2775,6 @@ register_diagnostics! {
E0245, // not a trait
E0246, // invalid recursive type
E0247, // found module name used as a type
E0248, // found value name used as a type
E0319, // trait impls for defaulted traits allowed just for structs/enums
E0320, // recursive overflow during dropck
E0321, // extended coherence rules for defaulted traits violated
Expand Down