Document enum types used as values for E0423
This commit is contained in:
parent
7d8ebe3128
commit
9cdcd0c3fa
1 changed files with 13 additions and 0 deletions
|
|
@ -44,3 +44,16 @@ fn h1() -> i32 {
|
|||
// did you mean `a::I`?
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Enum types used as values
|
||||
|
||||
Enums are types and cannot be used directly as values.
|
||||
|
||||
```compile_fail,E0423
|
||||
fn main() {
|
||||
let x = Option::<i32>;
|
||||
//~^ ERROR expected value, found enum `Option`
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue