os-rust/tests/ui/issues/issue-3574.rs

15 lines
253 B
Rust
Raw Permalink Normal View History

//@ run-pass
2012-12-06 18:32:13 -08:00
// rustc --test match_borrowed_str.rs.rs && ./match_borrowed_str.rs
fn compare(x: &str, y: &str) -> bool {
match x {
2012-12-06 18:32:13 -08:00
"foo" => y == "foo",
_ => y == "bar",
}
}
pub fn main() {
2013-03-28 18:39:09 -07:00
assert!(compare("foo", "foo"));
2012-12-06 18:32:13 -08:00
}