rust/tests/ui/pattern/usefulness/issue-78549-ref-pat-and-str.rs

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

26 lines
423 B
Rust
Raw Normal View History

// check-pass
// From https://github.com/rust-lang/rust/issues/78549
fn main() {
match "foo" {
"foo" => {},
&_ => {},
}
match "foo" {
&_ => {},
"foo" => {},
}
match ("foo", 0, "bar") {
(&_, 0, &_) => {},
("foo", _, "bar") => {},
(&_, _, &_) => {},
}
match (&"foo", "bar") {
(&"foo", &_) => {},
(&&_, &_) => {},
}
}