2018-08-08 12:28:26 +00:00
|
|
|
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/str-mut-idx.rs:4:15
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | s[1..2] = bot();
|
|
|
|
| ^^^ doesn't have a size known at compile-time
|
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
= help: the trait `Sized` is not implemented for `str`
|
2021-07-31 16:26:55 +00:00
|
|
|
note: required by a bound in `bot`
|
|
|
|
--> $DIR/str-mut-idx.rs:1:8
|
|
|
|
|
|
|
|
|
LL | fn bot<T>() -> T { loop {} }
|
|
|
|
| ^ required by this bound in `bot`
|
2020-03-12 03:38:21 +00:00
|
|
|
help: consider relaxing the implicit `Sized` restriction
|
|
|
|
|
|
|
|
|
LL | fn bot<T: ?Sized>() -> T { loop {} }
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/str-mut-idx.rs:4:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | s[1..2] = bot();
|
|
|
|
| ^^^^^^^ doesn't have a size known at compile-time
|
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
= help: the trait `Sized` is not implemented for `str`
|
2018-08-08 12:28:26 +00:00
|
|
|
= note: the left-hand-side of an assignment must have a statically known size
|
|
|
|
|
2019-01-14 13:10:45 +00:00
|
|
|
error[E0277]: the type `str` cannot be indexed by `usize`
|
2022-07-24 13:26:44 +00:00
|
|
|
--> $DIR/str-mut-idx.rs:7:7
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | s[1usize] = bot();
|
2022-07-24 13:26:44 +00:00
|
|
|
| ^^^^^^ string indices are ranges of `usize`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
= help: the trait `SliceIndex<str>` is not implemented for `usize`
|
2021-12-13 20:56:40 +00:00
|
|
|
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
|
2020-09-02 07:40:56 +00:00
|
|
|
= note: required because of the requirements on the impl of `Index<usize>` for `str`
|
2019-01-14 13:10:45 +00:00
|
|
|
|
|
|
|
error[E0277]: the type `str` cannot be indexed by `{integer}`
|
2019-09-16 04:58:20 +00:00
|
|
|
--> $DIR/str-mut-idx.rs:9:15
|
2019-01-14 13:10:45 +00:00
|
|
|
|
|
|
|
|
LL | s.get_mut(1);
|
2021-09-07 11:30:53 +00:00
|
|
|
| ------- ^ string indices are ranges of `usize`
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2019-01-14 13:10:45 +00:00
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
= help: the trait `SliceIndex<str>` is not implemented for `{integer}`
|
2019-01-05 02:56:23 +00:00
|
|
|
= note: you can use `.chars().nth()` or `.bytes().nth()`
|
2020-09-05 02:17:22 +00:00
|
|
|
for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
|
2021-12-13 20:56:40 +00:00
|
|
|
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
|
2021-10-05 23:04:09 +00:00
|
|
|
note: required by a bound in `core::str::<impl str>::get_mut`
|
|
|
|
--> $SRC_DIR/core/src/str/mod.rs:LL:COL
|
|
|
|
|
|
2022-03-06 03:00:12 +00:00
|
|
|
LL | pub const fn get_mut<I: ~const SliceIndex<str>>(&mut self, i: I) -> Option<&mut I::Output> {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `core::str::<impl str>::get_mut`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
2019-01-14 13:10:45 +00:00
|
|
|
error[E0277]: the type `str` cannot be indexed by `{integer}`
|
2019-09-16 04:58:20 +00:00
|
|
|
--> $DIR/str-mut-idx.rs:11:25
|
2019-01-14 13:10:45 +00:00
|
|
|
|
|
|
|
|
LL | s.get_unchecked_mut(1);
|
2021-09-07 11:30:53 +00:00
|
|
|
| ----------------- ^ string indices are ranges of `usize`
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2019-01-14 13:10:45 +00:00
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
= help: the trait `SliceIndex<str>` is not implemented for `{integer}`
|
2019-01-14 13:10:45 +00:00
|
|
|
= note: you can use `.chars().nth()` or `.bytes().nth()`
|
2020-09-05 02:17:22 +00:00
|
|
|
for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
|
2021-12-13 20:56:40 +00:00
|
|
|
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
|
2021-10-05 23:04:09 +00:00
|
|
|
note: required by a bound in `core::str::<impl str>::get_unchecked_mut`
|
|
|
|
--> $SRC_DIR/core/src/str/mod.rs:LL:COL
|
|
|
|
|
|
2022-03-06 03:00:12 +00:00
|
|
|
LL | pub const unsafe fn get_unchecked_mut<I: ~const SliceIndex<str>>(
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `core::str::<impl str>::get_unchecked_mut`
|
2019-01-14 13:10:45 +00:00
|
|
|
|
|
|
|
error[E0277]: the type `str` cannot be indexed by `char`
|
2022-07-24 13:26:44 +00:00
|
|
|
--> $DIR/str-mut-idx.rs:13:7
|
2019-01-14 13:10:45 +00:00
|
|
|
|
|
|
|
|
LL | s['c'];
|
2022-07-24 13:26:44 +00:00
|
|
|
| ^^^ string indices are ranges of `usize`
|
2019-01-14 13:10:45 +00:00
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
= help: the trait `SliceIndex<str>` is not implemented for `char`
|
|
|
|
= note: required because of the requirements on the impl of `Index<char>` for `str`
|
2019-01-14 13:10:45 +00:00
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|