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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
281 B
Rust
Raw Normal View History

// skip-filecheck
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,
}
}