Files
rust/tests/ui/enum/enum-variant-field-error-80607.rs

12 lines
284 B
Rust
Raw Permalink Normal View History

2025-07-13 16:56:31 -04:00
// https://github.com/rust-lang/rust/issues/80607
// This tests makes sure the diagnostics print the offending enum variant, not just the type.
pub enum Enum {
V1(i32),
}
pub fn foo(x: i32) -> Enum {
2021-01-02 11:06:30 +01:00
Enum::V1 { x } //~ ERROR `Enum::V1` has no field named `x`
}
fn main() {}