rust/src/test/compile-fail/issue-2848.rs
Tim Chevalier f39477d926 In resolve, check that an or-pattern has the same number of bindings in each disjunct
resolve3 wasn't checking this. Added test cases. Also added a helpful informational
message in the case where you have a variable binding that you probably think
refers to a variant that you forgot to import.

This is easier to do in resolve than in typeck because there's code in typeck
that assumes that each of the patterns binds the same number of variables.
2012-07-10 18:24:41 -07:00

16 lines
231 B
Rust

mod bar {
enum foo {
alpha,
beta,
charlie
}
}
fn main() {
import bar::{alpha, charlie};
alt alpha {
alpha | beta {} //~ ERROR: inconsistent number of bindings
charlie {}
}
}