rust/tests/ui/pattern/match-enum-struct-variant-field-missing.rs
reddevilmidzy 941a17a15a Relocate 5 tests from tests/ui/issues
Relocate issues/issue-51154.rs to closures/box-generic-closure.rs

Relocate issues/issue-51515.rs to
borrowck/assignment-to-immutable-ref.rs

Relocate issues/issue-53348.rs to mismatched_types/deref-string-assign.rs

Relocate issues/issue-52717.rs to
pattern/match-enum-struct-variant-field-missing.rs

Relocate issues/issue-53300.rs to
type/cannot-find-wrapper-with-impl-trait.rs
2025-11-27 00:39:52 +09:00

17 lines
446 B
Rust

//! Regression test for issue <https://github.com/rust-lang/rust/issues/52717>
//! Test that matching an enum struct variant with a missing or incorrect field name
//! correctly yields a "does not have a field named" error.
enum A {
A { foo: usize },
}
fn main() {
let x = A::A { foo: 3 };
match x {
A::A { fob } => {
//~^ ERROR does not have a field named `fob`
println!("{fob}");
}
}
}