summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/deref-patterns/string.rs
blob: 3a99c44aa0e18888100cd4b1e03d76fe3ddadc86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// compile-flags: -Z mir-opt-level=0 -C panic=abort

#![feature(string_deref_patterns)]
#![crate_type = "lib"]

// EMIT_MIR string.foo.PreCodegen.after.mir
pub fn foo(s: Option<String>) -> i32 {
    match s {
        Some("a") => 1234,
        s => 4321,
    }
}