]> git.lizzy.rs Git - rust.git/blob - tests/ui/rfc-2005-default-binding-mode/lit.rs
Rollup merge of #107168 - Nilstrieb:if-a-tait-falls-in-the-forest,can-we-know-it...
[rust.git] / tests / ui / rfc-2005-default-binding-mode / lit.rs
1 // FIXME(tschottdorf): we want these to compile, but they don't.
2
3 fn with_str() {
4     let s: &'static str = "abc";
5
6     match &s {
7             "abc" => true, //~ ERROR mismatched types
8             _ => panic!(),
9     };
10 }
11
12 fn with_bytes() {
13     let s: &'static [u8] = b"abc";
14
15     match &s {
16         b"abc" => true, //~ ERROR mismatched types
17         _ => panic!(),
18     };
19 }
20
21 pub fn main() {
22     with_str();
23     with_bytes();
24 }