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:
Matthias Krüger 2026-01-31 10:41:53 +01:00 committed by GitHub
commit 72f163cb48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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`
}
```