2015-07-04 12:30:00 +00:00
|
|
|
fn bot<T>() -> T { loop {} }
|
|
|
|
|
|
|
|
fn mutate(s: &mut str) {
|
|
|
|
s[1..2] = bot();
|
2018-07-10 21:10:13 +00:00
|
|
|
//~^ ERROR the size for values of type
|
|
|
|
//~| ERROR the size for values of type
|
2015-07-04 12:30:00 +00:00
|
|
|
s[1usize] = bot();
|
2019-01-14 13:10:45 +00:00
|
|
|
//~^ ERROR the type `str` cannot be indexed by `usize`
|
|
|
|
s.get_mut(1);
|
|
|
|
//~^ ERROR the type `str` cannot be indexed by `{integer}`
|
|
|
|
s.get_unchecked_mut(1);
|
|
|
|
//~^ ERROR the type `str` cannot be indexed by `{integer}`
|
|
|
|
s['c'];
|
|
|
|
//~^ ERROR the type `str` cannot be indexed by `char`
|
2015-07-04 12:30:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {}
|