summaryrefslogtreecommitdiffstats
path: root/library/core/src/slice/index.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/core/src/slice/index.rs')
-rw-r--r--library/core/src/slice/index.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/core/src/slice/index.rs b/library/core/src/slice/index.rs
index 6ef9f9c95..e1e3bcc05 100644
--- a/library/core/src/slice/index.rs
+++ b/library/core/src/slice/index.rs
@@ -152,7 +152,10 @@ mod private_slice_index {
#[rustc_on_unimplemented(
on(T = "str", label = "string indices are ranges of `usize`",),
on(
- all(any(T = "str", T = "&str", T = "std::string::String"), _Self = "{integer}"),
+ all(
+ any(T = "str", T = "&str", T = "alloc::string::String", T = "std::string::String"),
+ _Self = "{integer}"
+ ),
note = "you can use `.chars().nth()` or `.bytes().nth()`\n\
for more information, see chapter 8 in The Book: \
<https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>"