]> git.proxmox.com Git - rustc.git/blob - src/test/ui/str/str-idx.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / str / str-idx.rs
1 pub fn main() {
2 let s: &str = "hello";
3 let _: u8 = s[4]; //~ ERROR the type `str` cannot be indexed by `{integer}`
4 let _ = s.get(4); //~ ERROR the type `str` cannot be indexed by `{integer}`
5 let _ = s.get_unchecked(4); //~ ERROR the type `str` cannot be indexed by `{integer}`
6 let _: u8 = s['c']; //~ ERROR the type `str` cannot be indexed by `char`
7 }