-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.F-associated_type_bounds`#![feature(associated_type_bounds)]``#![feature(associated_type_bounds)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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) --^
}
}
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.F-associated_type_bounds`#![feature(associated_type_bounds)]``#![feature(associated_type_bounds)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.