]> git.proxmox.com Git - rustc.git/blob - src/test/ui/str/str-array-assignment.rs
New upstream version 1.42.0+dfsg1
[rustc.git] / src / test / ui / str / str-array-assignment.rs
1 fn main() {
2 let s = "abc";
3 let t = if true { s[..2] } else { s };
4 //~^ ERROR `if` and `else` have incompatible types
5 let u: &str = if true { s[..2] } else { s };
6 //~^ ERROR mismatched types
7 let v = s[..2];
8 //~^ ERROR the size for values of type
9 let w: &str = s[..2];
10 //~^ ERROR mismatched types
11 }