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();
|
2018-06-09 16:53:36 -07:00
|
|
|
//~^ ERROR the type `str` cannot be mutably indexed by `usize`
|
2015-07-04 15:30:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {}
|