rust/tests/mir-opt/deref-patterns/string.rs

13 lines
263 B
Rust
Raw Normal View History

2022-07-13 13:13:07 -05:00
// compile-flags: -Z mir-opt-level=0 -C panic=abort
2022-11-11 08:31:07 -06:00
#![feature(string_deref_patterns)]
2022-07-13 13:13:07 -05:00
#![crate_type = "lib"]
// EMIT_MIR string.foo.PreCodegen.after.mir
pub fn foo(s: Option<String>) -> i32 {
match s {
Some("a") => 1234,
s => 4321,
}
}