diff options
| author | Rageking8 <tomleetyt@gmail.com> | 2023-06-26 20:40:06 +0800 |
|---|---|---|
| committer | Rageking8 <tomleetyt@gmail.com> | 2023-06-27 18:13:24 +0800 |
| commit | 48544c1b12b50ab5fd6a772060c17bdb8b5a32d2 (patch) | |
| tree | 0041c26fbd014cf1c68b61c32b217b337f1000a6 /library/core/src/slice | |
| parent | 25b5af1b3a0b9e2c0c57b223b2d0e3e203869b2c (diff) | |
| download | rust-48544c1b12b50ab5fd6a772060c17bdb8b5a32d2.tar.gz rust-48544c1b12b50ab5fd6a772060c17bdb8b5a32d2.zip | |
Make `rustc_on_unimplemented` std-agnostic
Diffstat (limited to 'library/core/src/slice')
| -rw-r--r-- | library/core/src/slice/index.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/library/core/src/slice/index.rs b/library/core/src/slice/index.rs index 6ef9f9c95e8..e1e3bcc05e7 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>" |
