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
17 lines
446 B
Rust
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}");
|
|
}
|
|
}
|
|
}
|