Skip to content

Commit e90b21d

Browse files
committed
Update rustc_on_unimplementeds
1 parent a38e3cb commit e90b21d

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

library/core/src/convert/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ pub trait Into<T>: Sized {
575575
#[rustc_diagnostic_item = "From"]
576576
#[stable(feature = "rust1", since = "1.0.0")]
577577
#[rustc_on_unimplemented(on(
578-
all(_Self = "&str", T = "alloc::string::string::String"),
578+
all(_Self = "&str", T = "alloc::string::string::String<A>"),
579579
note = "to coerce a `{T}` into a `{Self}`, use `&*` as a prefix",
580580
))]
581581
#[doc(search_unbox)]

library/core/src/iter/traits/collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ pub trait FromIterator<A>: Sized {
264264
label = "`{Self}` is not an iterator; try calling `.chars()` or `.bytes()`"
265265
),
266266
on(
267-
_Self = "alloc::string::string::String",
267+
_Self = "alloc::string::string::String<A>",
268268
label = "`{Self}` is not an iterator; try calling `.chars()` or `.bytes()`"
269269
),
270270
on(

library/core/src/ops/index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#ind
153153
see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>"
154154
),
155155
on(
156-
_Self = "alloc::string::string::String",
156+
_Self = "alloc::string::string::String<A>",
157157
note = "you can use `.chars().nth()` or `.bytes().nth()`
158158
see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>"
159159
),

library/core/src/slice/index.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ mod private_slice_index {
161161
#[rustc_on_unimplemented(
162162
on(T = "str", label = "string indices are ranges of `usize`",),
163163
on(
164-
all(any(T = "str", T = "&str", T = "alloc::string::string::String"), _Self = "{integer}"),
164+
all(
165+
any(T = "str", T = "&str", T = "alloc::string::string::String<A>"),
166+
_Self = "{integer}"
167+
),
165168
note = "you can use `.chars().nth()` or `.bytes().nth()`\n\
166169
for more information, see chapter 8 in The Book: \
167170
<https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>"

src/tools/clippy/tests/ui/duplicated_attributes.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ fn foo() {}
2121
fn bar() {}
2222

2323
// No warning:
24-
#[rustc_on_unimplemented(on(_Self = "&str", label = "`a"), on(_Self = "alloc::string::String", label = "a"))]
24+
#[rustc_on_unimplemented(
25+
on(_Self = "&str", label = "`a"),
26+
on(_Self = "alloc::string::string::String<A>", label = "a")
27+
)]
2528
trait Abc {}
2629

2730
#[proc_macro_attr::duplicated_attr()] // Should not warn!

0 commit comments

Comments
 (0)