]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | error[E0277]: the type `str` cannot be indexed by `{integer}` |
0731742a | 2 | --> $DIR/str-idx.rs:3:17 |
b7449926 | 3 | | |
532ac7d7 | 4 | LL | let _: u8 = s[4]; |
9fa01778 | 5 | | ^^^^ string indices are ranges of `usize` |
b7449926 | 6 | | |
1b1a35ee | 7 | = help: the trait `SliceIndex<str>` is not implemented for `{integer}` |
9fa01778 | 8 | = note: you can use `.chars().nth()` or `.bytes().nth()` |
1b1a35ee XL |
9 | for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> |
10 | = note: required because of the requirements on the impl of `Index<{integer}>` for `str` | |
b7449926 | 11 | |
9fa01778 | 12 | error[E0277]: the type `str` cannot be indexed by `{integer}` |
e1599b0c | 13 | --> $DIR/str-idx.rs:4:19 |
9fa01778 | 14 | | |
532ac7d7 | 15 | LL | let _ = s.get(4); |
e1599b0c | 16 | | ^ string indices are ranges of `usize` |
9fa01778 | 17 | | |
1b1a35ee | 18 | = help: the trait `SliceIndex<str>` is not implemented for `{integer}` |
9fa01778 | 19 | = note: you can use `.chars().nth()` or `.bytes().nth()` |
1b1a35ee | 20 | for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> |
9fa01778 XL |
21 | |
22 | error[E0277]: the type `str` cannot be indexed by `{integer}` | |
e1599b0c | 23 | --> $DIR/str-idx.rs:5:29 |
9fa01778 | 24 | | |
532ac7d7 | 25 | LL | let _ = s.get_unchecked(4); |
e1599b0c | 26 | | ^ string indices are ranges of `usize` |
9fa01778 | 27 | | |
1b1a35ee | 28 | = help: the trait `SliceIndex<str>` is not implemented for `{integer}` |
9fa01778 | 29 | = note: you can use `.chars().nth()` or `.bytes().nth()` |
1b1a35ee | 30 | for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> |
9fa01778 XL |
31 | |
32 | error[E0277]: the type `str` cannot be indexed by `char` | |
33 | --> $DIR/str-idx.rs:6:17 | |
34 | | | |
532ac7d7 | 35 | LL | let _: u8 = s['c']; |
9fa01778 XL |
36 | | ^^^^^^ string indices are ranges of `usize` |
37 | | | |
1b1a35ee XL |
38 | = help: the trait `SliceIndex<str>` is not implemented for `char` |
39 | = note: required because of the requirements on the impl of `Index<char>` for `str` | |
9fa01778 XL |
40 | |
41 | error: aborting due to 4 previous errors | |
b7449926 XL |
42 | |
43 | For more information about this error, try `rustc --explain E0277`. |