]> git.lizzy.rs Git - rust.git/blob - src/test/ui/str/str-mut-idx.rs
Rollup merge of #56425 - scottmcm:redo-vec-set_len-docs, r=Centril
[rust.git] / src / test / ui / str / str-mut-idx.rs
1 fn bot<T>() -> T { loop {} }
2
3 fn mutate(s: &mut str) {
4     s[1..2] = bot();
5     //~^ ERROR the size for values of type
6     //~| ERROR the size for values of type
7     s[1usize] = bot();
8     //~^ ERROR the type `str` cannot be mutably indexed by `usize`
9 }
10
11 pub fn main() {}