Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
25
tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs
Normal file
25
tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs
Normal file
|
@ -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();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue