error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/str-mut-idx.rs:4:15 | LL | s[1..2] = bot(); | ^^^ doesn't have a size known at compile-time | = help: the trait `std::marker::Sized` is not implemented for `str` = note: to learn more, visit note: required by `bot` --> $DIR/str-mut-idx.rs:1:1 | LL | fn bot() -> T { loop {} } | ^^^^^^^^^^^^^^^^ error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/str-mut-idx.rs:4:5 | LL | s[1..2] = bot(); | ^^^^^^^ doesn't have a size known at compile-time | = help: the trait `std::marker::Sized` is not implemented for `str` = note: to learn more, visit = note: the left-hand-side of an assignment must have a statically known size error[E0277]: the type `str` cannot be indexed by `usize` --> $DIR/str-mut-idx.rs:7:5 | LL | s[1usize] = bot(); | ^^^^^^^^^ string indices are ranges of `usize` | = help: the trait `std::slice::SliceIndex` is not implemented for `usize` = note: required because of the requirements on the impl of `std::ops::Index` for `str` error[E0277]: the type `str` cannot be indexed by `{integer}` --> $DIR/str-mut-idx.rs:9:7 | LL | s.get_mut(1); | ^^^^^^^ string indices are ranges of `usize` | = help: the trait `std::slice::SliceIndex` is not implemented for `{integer}` = note: you can use `.chars().nth()` or `.bytes().nth()` see chapter in The Book error[E0277]: the type `str` cannot be indexed by `{integer}` --> $DIR/str-mut-idx.rs:11:7 | LL | s.get_unchecked_mut(1); | ^^^^^^^^^^^^^^^^^ string indices are ranges of `usize` | = help: the trait `std::slice::SliceIndex` is not implemented for `{integer}` = note: you can use `.chars().nth()` or `.bytes().nth()` see chapter in The Book error[E0277]: the type `str` cannot be indexed by `char` --> $DIR/str-mut-idx.rs:13:5 | LL | s['c']; | ^^^^^^ string indices are ranges of `usize` | = help: the trait `std::slice::SliceIndex` is not implemented for `char` = note: required because of the requirements on the impl of `std::ops::Index` for `str` error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0277`.