Change:
Given the following code: The current output is: <!-- The following is not always necessary. --Ideally the output should look like: Keeping the other error may or may not make sense, but I propose adding this, as it points more towards how to fix the issue and prevents barking up the tree of how a derive(Copy)'d type can not implement copy (there's a good answer here, but it was not immediately obvious to me upon seeing the original error). I generated this error message by removing the derive line from the AABB struct. This bug takes place on beta and nightly according to the Rust playground. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
That's the exact error from Rust 1.43.0 onward, before that it doesn't say what derive the error comes from. Just clarifying that this is not a recent change.
The error has gotten (slightly) better on nightly since a recent change of mine: It only suggests one of the missing bounds, adding then another error suggests adding ...
It would be nice if the that ends up being used in the "the impl for requires that " note pointed at the field type, instead of the whole field as it does now. Would that be something you'd have time to explore? The actual change is simple enough, but finding where the obligation is constructed might require some exploring.
I'll put it on my to-do list. I'm pretty sure the obligation is just constructed in , but maybe it's a sub-obligation. claim

Discussion:
tcx: TyCtxt<'tcx>, param_env: ty::ParamEnv<'tcx>, self_type: Ty<'tcx>, <del> cause: ObligationCause<'tcx>, </del> <ins> parent_cause: ObligationCause<'tcx>, </ins> ) -> Result<(), CopyImplementationError<'tcx>> { // FIXME: (@jroesch) float this code up tcx.infer_ctxt().enter(|infcx| {

.ty(tcx, traits::InternalSubsts::identity_for_item(tcx, adt.did())) .has_param_types_or_consts() { <del> cause.clone() </del> <ins> parent_cause.clone() </ins> } else { ObligationCause::dummy_with_span(span) };

for (field, ty) in fields { let field_span = tcx.def_span(field.did); <ins> let field_ty_span = match tcx.hir().get_if_local(field.did) { Some(hir::Node::Field(field_def)) => field_def.ty.span, _ => field_span, }; </ins> err.span_label(field_span, "this field does not implement `Copy`"); // Spin up a new FulfillmentContext, so we can get the _precise_ reason // why this field does not implement Copy. This is useful because sometimes

param_env, ty, tcx.lang_items().copy_trait().unwrap(), <del> traits::ObligationCause::dummy_with_span(field_span), </del> <ins> traits::ObligationCause::dummy_with_span(field_ty_span), </ins> ); for error in fulfill_cx.select_all_or_error(&infcx) { let error_predicate = error.obligation.predicate;

|     -------------------- this field does not implement `Copy` | note: the `Copy` impl for `Vector2<K>` requires that `K: Debug` <del> --> $DIR/missing-bound-in-derive-copy-impl-3.rs:12:5 </del> <ins> --> $DIR/missing-bound-in-derive-copy-impl-3.rs:12:14 </ins> | LL |     pub loc: Vector2<K>, <del> |     ^^^^^^^^^^^^^^^^^^^ </del> <ins> |              ^^^^^^^^^^ </ins> LL |     pub size: Vector2<K> <del> |     ^^^^^^^^^^^^^^^^^^^^ </del> <ins> |               ^^^^^^^^^^ </ins> = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting this bound |

|     -------------------- this field does not implement `Copy` | note: the `Copy` impl for `Vector2<K>` requires that `K: Debug` <del> --> $DIR/missing-bound-in-derive-copy-impl.rs:11:5 </del> <ins> --> $DIR/missing-bound-in-derive-copy-impl.rs:11:14 </ins> | LL |     pub loc: Vector2<K>, <del> |     ^^^^^^^^^^^^^^^^^^^ </del> <ins> |              ^^^^^^^^^^ </ins> LL |     pub size: Vector2<K> <del> |     ^^^^^^^^^^^^^^^^^^^^ </del> <ins> |               ^^^^^^^^^^ </ins> = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `K` |

|      ^^^^ | note: the `Copy` impl for `ManuallyDrop<String>` requires that `String: Copy` <del> --> $DIR/union-copy.rs:8:5 </del> <ins> --> $DIR/union-copy.rs:8:8 </ins> | LL |     a: std::mem::ManuallyDrop<String> <del> |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ </del> <ins> |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ </ins> error: aborting due to previous error