Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion impl/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ fn render_enum(
provide_match_arms.push(expr);
}

bounds.extend(parsed_fields.bounds.into_iter());
bounds.extend(parsed_fields.bounds);
}

let render = |match_arms: &mut Vec<TokenStream>, unmatched| {
Expand Down
8 changes: 7 additions & 1 deletion tests/compile_fail/as_mut/renamed_generic.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ error[E0599]: the method `as_mut` exists for struct `Baz<i32>`, but its trait bo
11 | let _: &mut Bar<i32> = item.as_mut();
| ^^^^^^ method cannot be called on `Baz<i32>` due to unsatisfied trait bounds
|
= note: trait bound `Foo<i32>: AsMut<Foo<i32>>` was not satisfied
note: trait bound `Foo<i32>: AsMut<Foo<i32>>` was not satisfied
--> tests/compile_fail/as_mut/renamed_generic.rs:5:10
|
5 | #[derive(derive_more::AsMut)]
| ^^^^^^^^^^^^^^^^^^ type parameter would need to implement `AsMut`
note: the trait `AsMut` must be implemented
--> $RUST/core/src/convert/mod.rs
= help: consider manually implementing the trait to avoid undesired bounds
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `as_mut`, perhaps you need to implement it:
candidate #1: `AsMut`
= note: this error originates in the derive macro `derive_more::AsMut` (in Nightly builds, run with -Z macro-backtrace for more info)
8 changes: 7 additions & 1 deletion tests/compile_fail/as_ref/renamed_generic.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ error[E0599]: the method `as_ref` exists for struct `Baz<i32>`, but its trait bo
11 | let _: &Bar<i32> = item.as_ref();
| ^^^^^^ method cannot be called on `Baz<i32>` due to unsatisfied trait bounds
|
= note: trait bound `Foo<i32>: AsRef<Foo<i32>>` was not satisfied
note: trait bound `Foo<i32>: AsRef<Foo<i32>>` was not satisfied
--> tests/compile_fail/as_ref/renamed_generic.rs:5:10
|
5 | #[derive(derive_more::AsRef)]
| ^^^^^^^^^^^^^^^^^^ type parameter would need to implement `AsRef`
note: the trait `AsRef` must be implemented
--> $RUST/core/src/convert/mod.rs
= help: consider manually implementing the trait to avoid undesired bounds
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `as_ref`, perhaps you need to implement it:
candidate #1: `AsRef`
= note: this error originates in the derive macro `derive_more::AsRef` (in Nightly builds, run with -Z macro-backtrace for more info)
6 changes: 3 additions & 3 deletions tests/compile_fail/eq/non_eq_field.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error[E0277]: the trait bound `f32: std::cmp::Eq` is not satisfied
error[E0277]: the trait bound `f32: Eq` is not satisfied
--> tests/compile_fail/eq/non_eq_field.rs:1:10
|
1 | #[derive(derive_more::Eq)]
| ^^^^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `f32`
| ^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `f32`
|
= help: the following other types implement trait `std::cmp::Eq`:
= help: the following other types implement trait `Eq`:
i128
i16
i32
Expand Down
8 changes: 4 additions & 4 deletions tests/compile_fail/eq/non_eq_field_recursive.stderr
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
error[E0277]: the trait bound `NotEq<IntOrFloat>: std::cmp::Eq` is not satisfied
error[E0277]: the trait bound `NotEq<IntOrFloat>: Eq` is not satisfied
--> tests/compile_fail/eq/non_eq_field_recursive.rs:1:10
|
1 | #[derive(derive_more::Eq)]
| ^^^^^^^^^^^^^^^ unsatisfied trait bound
|
help: the trait `std::cmp::Eq` is not implemented for `NotEq<IntOrFloat>`
help: the trait `Eq` is not implemented for `NotEq<IntOrFloat>`
--> tests/compile_fail/eq/non_eq_field_recursive.rs:14:1
|
14 | struct NotEq<T>(f32, T);
| ^^^^^^^^^^^^^^^
help: the trait `std::cmp::Eq` is implemented for `Box<T, A>`
help: the trait `Eq` is implemented for `Box<T, A>`
--> $RUST/alloc/src/boxed.rs
= note: required for `Box<NotEq<IntOrFloat>>` to implement `std::cmp::Eq`
= note: required for `Box<NotEq<IntOrFloat>>` to implement `Eq`
note: required by a bound in `derive_more::__private::AssertParamIsEq`
--> src/cmp.rs
|
Expand Down
Loading