]> git.lizzy.rs Git - rust.git/blob - src/test/ui/typeck/issue-55810-must-typeck-match-pats-before-guards.rs
Merge commit '91496c2ac6abf6454c413bb23e8becf6b6dc20ea' into clippyup
[rust.git] / src / test / ui / typeck / issue-55810-must-typeck-match-pats-before-guards.rs
1 // check-pass
2
3 // rust-lang/rust#55810: types for a binding in a match arm can be
4 // inferred from arms that come later in the match.
5
6 struct S;
7
8 impl S {
9     fn method(&self) -> bool {
10         unimplemented!()
11     }
12 }
13
14 fn get<T>() -> T {
15     unimplemented!()
16 }
17
18 fn main() {
19     match get() {
20         x if x.method() => {}
21         &S => {}
22     }
23 }