Closed
Description
With the following, the error appears in the wrong place (1), while it should be at (2).
//~ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied
// (1) --^
#![feature(associated_type_bounds)]
fn main() {}
trait Bar { type Assoc; }
trait Thing {
type Out;
fn func() -> Self::Out;
}
struct AssocNoCopy;
impl Bar for AssocNoCopy { type Assoc = String; }
impl Thing for AssocNoCopy {
type Out = Box<dyn Bar<Assoc: Copy>>;
fn func() -> Self::Out {
Box::new(AssocNoCopy)
//~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied
// (2) --^
}
}