1
Fork 0

Better group RFC ui tests together

This commit is contained in:
Maybe Waffle 2023-05-29 15:43:15 +00:00
parent 7452822843
commit 9d3482c403
543 changed files with 145 additions and 145 deletions

View file

@ -1,34 +1,24 @@
// run-pass
#![allow(dead_code)]
fn with_u8() {
let s = 5u8;
let r = match &s {
4 => false,
5 => true,
_ => false,
};
assert!(r);
}
// FIXME(tschottdorf): we want these to compile, but they don't.
// A string literal isn't mistaken for a non-ref pattern (in which case we'd
// deref `s` and mess things up).
fn with_str() {
let s: &'static str = "abc";
match s {
"abc" => true,
match &s {
"abc" => true, //~ ERROR mismatched types
_ => panic!(),
};
}
// Ditto with byte strings.
fn with_bytes() {
let s: &'static [u8] = b"abc";
match s {
b"abc" => true,
match &s {
b"abc" => true, //~ ERROR mismatched types
_ => panic!(),
};
}
pub fn main() {
with_str();
with_bytes();
}