Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
12
tests/ui/array-slice-vec/slice-mut.rs
Normal file
12
tests/ui/array-slice-vec/slice-mut.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
// Test mutability and slicing syntax.
|
||||
|
||||
fn main() {
|
||||
let x: &[isize] = &[1, 2, 3, 4, 5];
|
||||
// Immutable slices are not mutable.
|
||||
|
||||
let y: &mut[_] = &x[2..4];
|
||||
//~^ ERROR mismatched types
|
||||
//~| expected mutable reference `&mut [_]`
|
||||
//~| found reference `&[isize]`
|
||||
//~| types differ in mutability
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue