-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
544 changed files
with
146 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// run-pass | ||
pub fn main() { | ||
let mut tups = vec![(0u8, 1u8)]; | ||
|
||
for (n, m) in &tups { | ||
let _: &u8 = n; | ||
let _: &u8 = m; | ||
} | ||
|
||
for (n, m) in &mut tups { | ||
*n += 1; | ||
*m += 2; | ||
} | ||
|
||
assert_eq!(tups, vec![(1u8, 3u8)]); | ||
|
||
for (n, m) in tups { | ||
println!("{} {}", m, n); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,9 @@ | ||
// run-pass | ||
pub fn main() { | ||
let mut tups = vec![(0u8, 1u8)]; | ||
|
||
for (n, m) in &tups { | ||
let _: &u8 = n; | ||
let _: &u8 = m; | ||
} | ||
struct Foo {} | ||
|
||
for (n, m) in &mut tups { | ||
*n += 1; | ||
*m += 2; | ||
} | ||
|
||
assert_eq!(tups, vec![(1u8, 3u8)]); | ||
|
||
for (n, m) in tups { | ||
println!("{} {}", m, n); | ||
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 | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// run-pass | ||
#![allow(dead_code)] | ||
fn with_u8() { | ||
let s = 5u8; | ||
let r = match &s { | ||
4 => false, | ||
5 => true, | ||
_ => false, | ||
}; | ||
assert!(r); | ||
} | ||
|
||
// 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, | ||
_ => panic!(), | ||
}; | ||
} | ||
|
||
// Ditto with byte strings. | ||
fn with_bytes() { | ||
let s: &'static [u8] = b"abc"; | ||
match s { | ||
b"abc" => true, | ||
_ => panic!(), | ||
}; | ||
} | ||
|
||
pub fn main() { | ||
with_str(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// run-pass | ||
|
||
fn slice_pat() { | ||
let sl: &[u8] = b"foo"; | ||
|
||
match sl { | ||
[first, remainder @ ..] => { | ||
let _: &u8 = first; | ||
assert_eq!(first, &b'f'); | ||
assert_eq!(remainder, b"oo"); | ||
} | ||
[] => panic!(), | ||
} | ||
} | ||
|
||
fn slice_pat_omission() { | ||
match &[0, 1, 2] { | ||
[..] => {} | ||
}; | ||
} | ||
|
||
fn main() { | ||
slice_pat(); | ||
slice_pat_omission(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,7 @@ | ||
// run-pass | ||
|
||
fn slice_pat() { | ||
pub fn main() { | ||
let sl: &[u8] = b"foo"; | ||
|
||
match sl { | ||
[first, remainder @ ..] => { | ||
let _: &u8 = first; | ||
assert_eq!(first, &b'f'); | ||
assert_eq!(remainder, b"oo"); | ||
} | ||
[] => panic!(), | ||
} | ||
} | ||
|
||
fn slice_pat_omission() { | ||
match &[0, 1, 2] { | ||
[..] => {} | ||
}; | ||
} | ||
|
||
fn main() { | ||
slice_pat(); | ||
slice_pat_omission(); | ||
match sl { //~ ERROR non-exhaustive patterns | ||
[first, remainder @ ..] => {}, | ||
}; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.