2015-07-04 15:30:00 +03:00
|
|
|
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
|
2015-07-04 15:30:00 +03:00
|
|
|
s[1usize] = bot();
|
2019-01-14 08:10:45 -05: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 15:30:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {}
|