2018-08-08 14:28:26 +02:00
|
|
|
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/str-mut-idx.rs:4:15
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
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`
|
2018-08-08 14:50:16 +02:00
|
|
|
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
2018-08-08 14:28:26 +02:00
|
|
|
note: required by `bot`
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/str-mut-idx.rs:1:1
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | fn bot<T>() -> T { loop {} }
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/str-mut-idx.rs:4:5
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
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`
|
2018-08-08 14:50:16 +02:00
|
|
|
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
2018-08-08 14:28:26 +02:00
|
|
|
= note: the left-hand-side of an assignment must have a statically known size
|
|
|
|
|
|
|
|
error[E0277]: the type `str` cannot be mutably indexed by `usize`
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/str-mut-idx.rs:7:5
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | s[1usize] = bot();
|
|
|
|
| ^^^^^^^^^ `str` cannot be mutably indexed by `usize`
|
|
|
|
|
|
|
|
|
= help: the trait `std::ops::IndexMut<usize>` is not implemented for `str`
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|