Rollup merge of #151892 - chahar-ritik:e0423-enum-doc, r=Kivooeo
Document enum types used as values for E0423
### Problem
The E0423 error explanation did not include an example for enum types being used
as values, which is a common source of confusion for users.
For example, the following code:
```rust
fn main() {
let x = Option::<i32>;
}
```
This commit is contained in:
commit
72f163cb48
1 changed files with 11 additions and 0 deletions
|
|
@ -44,3 +44,14 @@ 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