summaryrefslogtreecommitdiffstats
path: root/src/test/ui/let-else/let-else-no-double-error.rs
blob: 35dcdd3f6be3c1cb842c2c78ead0a3cc3db04d9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// from rfc2005 test suite

#![feature(let_else)]

// Without caching type lookups in FnCtxt.resolve_ty_and_def_ufcs
// the error below would be reported twice (once when checking
// for a non-ref pattern, once when processing the pattern).

fn main() {
    let foo = 22;
    let u32::XXX = foo else { return }; //~ ERROR: no associated item named `XXX` found for type `u32` in the current scope [E0599]
}