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,22 +0,0 @@
enum Wrapper {
Wrap(i32),
}
use Wrapper::Wrap;
pub fn main() {
let Wrap(x) = &Wrap(3);
*x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
if let Some(x) = &Some(3) {
*x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
} else {
panic!();
}
while let Some(x) = &Some(3) {
*x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
break;
}
}

View File

@ -1,9 +0,0 @@
struct Foo {}
pub fn main() {
let mut tups = vec![(Foo {}, Foo {})];
// The below desugars to &(ref n, mut m).
for (n, mut m) in &tups {
//~^ ERROR cannot move out of a shared reference
}
}

View File

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

View File

@ -1,7 +0,0 @@
pub fn main() {
let sl: &[u8] = b"foo";
match sl { //~ ERROR non-exhaustive patterns
[first, remainder @ ..] => {},
};
}

View File

@ -0,0 +1,45 @@
// run-pass
enum Wrapper {
Wrap(i32),
}
use Wrapper::Wrap;
pub fn main() {
let Wrap(x) = &Wrap(3);
println!("{}", *x);
let Wrap(x) = &mut Wrap(3);
println!("{}", *x);
if let Some(x) = &Some(3) {
println!("{}", *x);
} else {
panic!();
}
if let Some(x) = &mut Some(3) {
println!("{}", *x);
} else {
panic!();
}
if let Some(x) = &mut Some(3) {
*x += 1;
} else {
panic!();
}
while let Some(x) = &Some(3) {
println!("{}", *x);
break;
}
while let Some(x) = &mut Some(3) {
println!("{}", *x);
break;
}
while let Some(x) = &mut Some(3) {
*x += 1;
break;
}
}

View File

@ -1,4 +1,3 @@
// run-pass
enum Wrapper {
Wrap(i32),
}
@ -7,39 +6,17 @@ use Wrapper::Wrap;
pub fn main() {
let Wrap(x) = &Wrap(3);
println!("{}", *x);
*x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
let Wrap(x) = &mut Wrap(3);
println!("{}", *x);
if let Some(x) = &Some(3) {
println!("{}", *x);
} else {
panic!();
}
if let Some(x) = &mut Some(3) {
println!("{}", *x);
} else {
panic!();
}
if let Some(x) = &mut Some(3) {
*x += 1;
*x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
} else {
panic!();
}
while let Some(x) = &Some(3) {
println!("{}", *x);
break;
}
while let Some(x) = &mut Some(3) {
println!("{}", *x);
break;
}
while let Some(x) = &mut Some(3) {
*x += 1;
*x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
break;
}
}

Some files were not shown because too many files have changed in this diff Show More