summaryrefslogtreecommitdiff
path: root/tests/ui/generator/drop-tracking-error-body.rs
blob: f99d9ab6bf860c224ca5eb7afdf8913d25218bb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// compile-flags: -Zdrop-tracking-mir --edition=2021

#![feature(generators)]

pub async fn async_bad_body() {
    match true {} //~ ERROR non-exhaustive patterns: type `bool` is non-empty
}

pub fn generator_bad_body() {
    || {
        // 'non-exhaustive pattern' only seems to be reported once, so this annotation doesn't work
        // keep the function around so we can make sure it doesn't ICE
        match true {}; // ERROR non-exhaustive patterns: type `bool` is non-empty
        yield ();
    };
}

fn main() {}