mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-13 23:42:56 +00:00
Auto merge of #112071 - WaffleLapkin:group-rfcs-tests, r=oli-obk
Group rfcs tests This moves all RFC tests to `tests/ui/rfcs/rfc-NNNN-title-title-title/...` I had to rename some tests due to conflicts, but otherwise this is just a move.
This commit is contained in:
commit
e6d4725c76
@ -11,7 +11,7 @@ use std::path::{Path, PathBuf};
|
||||
const ENTRY_LIMIT: usize = 900;
|
||||
// FIXME: The following limits should be reduced eventually.
|
||||
const ISSUES_ENTRY_LIMIT: usize = 1898;
|
||||
const ROOT_ENTRY_LIMIT: usize = 891;
|
||||
const ROOT_ENTRY_LIMIT: usize = 871;
|
||||
|
||||
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
|
||||
"rs", // test source files
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -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
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
pub fn main() {
|
||||
let sl: &[u8] = b"foo";
|
||||
|
||||
match sl { //~ ERROR non-exhaustive patterns
|
||||
[first, remainder @ ..] => {},
|
||||
};
|
||||
}
|
45
tests/ui/rfcs/rfc-2005-default-binding-mode/enum-ok.rs
Normal file
45
tests/ui/rfcs/rfc-2005-default-binding-mode/enum-ok.rs
Normal 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;
|
||||
}
|
||||
}
|
@ -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
Loading…
Reference in New Issue
Block a user