diff --git a/impl/src/error.rs b/impl/src/error.rs index 9f38a761..a801dc20 100644 --- a/impl/src/error.rs +++ b/impl/src/error.rs @@ -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, unmatched| { diff --git a/tests/compile_fail/as_mut/renamed_generic.stderr b/tests/compile_fail/as_mut/renamed_generic.stderr index 1a7dfe1b..44bc9df0 100644 --- a/tests/compile_fail/as_mut/renamed_generic.stderr +++ b/tests/compile_fail/as_mut/renamed_generic.stderr @@ -10,9 +10,15 @@ error[E0599]: the method `as_mut` exists for struct `Baz`, but its trait bo 11 | let _: &mut Bar = item.as_mut(); | ^^^^^^ method cannot be called on `Baz` due to unsatisfied trait bounds | - = note: trait bound `Foo: AsMut>` was not satisfied +note: trait bound `Foo: AsMut>` 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) diff --git a/tests/compile_fail/as_ref/renamed_generic.stderr b/tests/compile_fail/as_ref/renamed_generic.stderr index 304c3d9a..3ece6ac8 100644 --- a/tests/compile_fail/as_ref/renamed_generic.stderr +++ b/tests/compile_fail/as_ref/renamed_generic.stderr @@ -10,9 +10,15 @@ error[E0599]: the method `as_ref` exists for struct `Baz`, but its trait bo 11 | let _: &Bar = item.as_ref(); | ^^^^^^ method cannot be called on `Baz` due to unsatisfied trait bounds | - = note: trait bound `Foo: AsRef>` was not satisfied +note: trait bound `Foo: AsRef>` 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) diff --git a/tests/compile_fail/eq/non_eq_field.stderr b/tests/compile_fail/eq/non_eq_field.stderr index c24cbf0a..ae02e14a 100644 --- a/tests/compile_fail/eq/non_eq_field.stderr +++ b/tests/compile_fail/eq/non_eq_field.stderr @@ -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 diff --git a/tests/compile_fail/eq/non_eq_field_recursive.stderr b/tests/compile_fail/eq/non_eq_field_recursive.stderr index 76563fbe..0119f739 100644 --- a/tests/compile_fail/eq/non_eq_field_recursive.stderr +++ b/tests/compile_fail/eq/non_eq_field_recursive.stderr @@ -1,17 +1,17 @@ -error[E0277]: the trait bound `NotEq: std::cmp::Eq` is not satisfied +error[E0277]: the trait bound `NotEq: 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` +help: the trait `Eq` is not implemented for `NotEq` --> tests/compile_fail/eq/non_eq_field_recursive.rs:14:1 | 14 | struct NotEq(f32, T); | ^^^^^^^^^^^^^^^ -help: the trait `std::cmp::Eq` is implemented for `Box` +help: the trait `Eq` is implemented for `Box` --> $RUST/alloc/src/boxed.rs - = note: required for `Box>` to implement `std::cmp::Eq` + = note: required for `Box>` to implement `Eq` note: required by a bound in `derive_more::__private::AssertParamIsEq` --> src/cmp.rs |