1
Fork 0
rust/src/test/ui/str/str-mut-idx.rs

12 lines
272 B
Rust
Raw Normal View History

fn bot<T>() -> T { loop {} }
fn mutate(s: &mut str) {
s[1..2] = bot();
2018-07-10 23:10:13 +02:00
//~^ ERROR the size for values of type
//~| ERROR the size for values of type
s[1usize] = bot();
//~^ ERROR the type `str` cannot be mutably indexed by `usize`
}
pub fn main() {}