rust/tests/ui/deref-patterns/refs.rs

19 lines
261 B
Rust
Raw Normal View History

2022-07-13 13:13:07 -05:00
// check-pass
2022-11-11 08:31:07 -06:00
#![feature(string_deref_patterns)]
2022-07-13 13:13:07 -05:00
fn foo(s: &String) -> i32 {
match *s {
"a" => 42,
_ => -1,
}
}
fn bar(s: Option<&&&&String>) -> i32 {
match s {
Some(&&&&"&&&&") => 1,
_ => -1,
}
}
fn main() {}