]> git.proxmox.com Git - rustc.git/blame - src/test/ui/slice-mut.rs
New upstream version 1.50.0+dfsg1
[rustc.git] / src / test / ui / slice-mut.rs
CommitLineData
1a4d82fc 1// Test mutability and slicing syntax.
223e47cc
LB
2
3fn main() {
1a4d82fc
JJ
4 let x: &[isize] = &[1, 2, 3, 4, 5];
5 // Immutable slices are not mutable.
85aaf69f
SL
6
7 let y: &mut[_] = &x[2..4];
8 //~^ ERROR mismatched types
60c5eb7d
XL
9 //~| expected mutable reference `&mut [_]`
10 //~| found reference `&[isize]`
9e0c209e 11 //~| types differ in mutability
223e47cc 12}