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