rust/tests/ui/rfcs/rfc-2005-default-binding-mode/lit.rs

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

25 lines
427 B
Rust
Raw Normal View History

2023-05-29 10:43:15 -05:00
// FIXME(tschottdorf): we want these to compile, but they don't.
fn with_str() {
let s: &'static str = "abc";
2023-05-29 10:43:15 -05:00
match &s {
"abc" => true, //~ ERROR mismatched types
_ => panic!(),
};
}
fn with_bytes() {
let s: &'static [u8] = b"abc";
2023-05-29 10:43:15 -05:00
match &s {
b"abc" => true, //~ ERROR mismatched types
_ => panic!(),
};
}
pub fn main() {
with_str();
2023-05-29 10:43:15 -05:00
with_bytes();
}