reword span label

This commit is contained in:
Esteban Küber 2026-01-19 18:59:32 +00:00
parent b534229a3a
commit 6c8eee8297
7 changed files with 10 additions and 10 deletions

View file

@ -3600,7 +3600,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
spans.push_span_label(
data.span,
if data.span.in_derive_expansion() {
format!("would need to be `{trait_name}`")
format!("type parameter would need to implement `{trait_name}`")
} else {
format!("unsatisfied trait bound")
},

View file

@ -101,7 +101,7 @@ note: required for `Bar<dyn Debug>` to implement `Eq`
LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
| -- in this derive macro expansion
LL | struct Bar<T>(T);
| ^^^ - would need to be `Eq`
| ^^^ - type parameter would need to implement `Eq`
= help: consider manually implementing `Eq` to avoid undesired bounds
= note: 1 redundant requirement hidden
= note: required for `&'static Bar<dyn Debug>` to implement `Eq`

View file

@ -10,7 +10,7 @@ note: required for `Foo<String>` to implement `Copy`
LL | #[derive(Copy, Clone)]
| ---- in this derive macro expansion
LL | struct Foo<T>(T);
| ^^^ - would need to be `Copy`
| ^^^ - type parameter would need to implement `Copy`
= help: consider manually implementing `Copy` to avoid undesired bounds
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: create an inline `const` block

View file

@ -12,7 +12,7 @@ note: required for `B<C>` to implement `Copy`
LL | #[derive(Copy, Clone)]
| ---- in this derive macro expansion
LL | struct B<T> {
| ^ - would need to be `Copy`
| ^ - type parameter would need to implement `Copy`
= help: consider manually implementing `Copy` to avoid undesired bounds
note: required by a bound in `is_copy`
--> $DIR/deriving-copyclone.rs:18:15
@ -38,7 +38,7 @@ note: required for `B<C>` to implement `Clone`
LL | #[derive(Copy, Clone)]
| ----- in this derive macro expansion
LL | struct B<T> {
| ^ - would need to be `Clone`
| ^ - type parameter would need to implement `Clone`
= help: consider manually implementing `Clone` to avoid undesired bounds
note: required by a bound in `is_clone`
--> $DIR/deriving-copyclone.rs:19:16
@ -64,7 +64,7 @@ note: required for `B<D>` to implement `Copy`
LL | #[derive(Copy, Clone)]
| ---- in this derive macro expansion
LL | struct B<T> {
| ^ - would need to be `Copy`
| ^ - type parameter would need to implement `Copy`
= help: consider manually implementing `Copy` to avoid undesired bounds
note: required by a bound in `is_copy`
--> $DIR/deriving-copyclone.rs:18:15

View file

@ -34,7 +34,7 @@ note: required for `Fooy<T>` to implement `Copy`
LL | #[derive(Copy, Clone)]
| ---- in this derive macro expansion
LL | struct Fooy<T>(T);
| ^^^^ - would need to be `Copy`
| ^^^^ - type parameter would need to implement `Copy`
= help: consider manually implementing `Copy` to avoid undesired bounds
note: the requirement `Fooy<T>: Copy` appears on the `impl`'s associated type `C` but not on the corresponding trait's associated type
--> $DIR/impl_bounds.rs:6:10
@ -61,7 +61,7 @@ note: required for `Fooy<T>` to implement `Copy`
LL | #[derive(Copy, Clone)]
| ---- in this derive macro expansion
LL | struct Fooy<T>(T);
| ^^^^ - would need to be `Copy`
| ^^^^ - type parameter would need to implement `Copy`
= help: consider manually implementing `Copy` to avoid undesired bounds
note: the requirement `Fooy<T>: Copy` appears on the `impl`'s associated function `d` but not on the corresponding trait's associated function
--> $DIR/impl_bounds.rs:7:8

View file

@ -43,7 +43,7 @@ LL | #[derive(PartialOrd, AddImpl)]
| ---------- in this derive macro expansion
...
LL | struct PriorityQueue<T>(BinaryHeap<PriorityQueueEntry<T>>);
| ^^^^^^^^^^^^^ - would need to be `PartialOrd`
| ^^^^^^^^^^^^^ - type parameter would need to implement `PartialOrd`
= help: consider manually implementing `PartialOrd` to avoid undesired bounds
note: required by a bound in `Ord`
--> $SRC_DIR/core/src/cmp.rs:LL:COL

View file

@ -13,7 +13,7 @@ note: required for `Id<SomeNode>` to implement `PartialEq`
LL | #[derive(PartialEq, Eq)]
| --------- in this derive macro expansion
LL | pub struct Id<T>(PhantomData<T>);
| ^^ - would need to be `PartialEq`
| ^^ - type parameter would need to implement `PartialEq`
= help: consider manually implementing `PartialEq` to avoid undesired bounds
note: required by a bound in `accept_eq`
--> $DIR/derive-implicit-bound.rs:17:23