-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
A-lintArea: New lintsArea: New lintsL-styleLint: Belongs in the style lint groupLint: Belongs in the style lint groupL-unnecessaryLint: Warn about unnecessary codeLint: Warn about unnecessary codeT-middleType: Probably requires verifiying typesType: Probably requires verifiying typesgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
Even though all fields of a struct are matched explicitly, it's still allowed to add a ..
pattern. This can improve forward compatibility, but I think it's equivalent to having a wildcard pattern after matching all enum variants explicitly (which is forbidden in Rust).
struct A {
a: i32,
b: i64,
c: &'static str,
}
fn main() {
match unimplemented!() {
A { a: 5, b: 6, c: "", .. } => {}
_ => {},
}
}
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsL-styleLint: Belongs in the style lint groupLint: Belongs in the style lint groupL-unnecessaryLint: Warn about unnecessary codeLint: Warn about unnecessary codeT-middleType: Probably requires verifiying typesType: Probably requires verifiying typesgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy