Files
rust/tests/ui/borrowck/string-borrowing-pattern-matching-11869.rs

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

18 lines
275 B
Rust
Raw Normal View History

2025-07-13 16:06:48 -04:00
// https://github.com/rust-lang/rust/issues/11869
//@ check-pass
#![allow(dead_code)]
2014-10-02 21:52:06 +02:00
struct A {
a: String
}
fn borrow<'a>(binding: &'a A) -> &'a str {
match &*binding.a {
2014-10-02 21:52:06 +02:00
"in" => "in_",
"ref" => "ref_",
ident => ident
}
}
fn main() {}