-
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)
Description
For example, this code does not compile:
trait Foo {
type A;
fn foo(&self) {}
}
impl Foo for usize {
type A = usize;
}
struct Bar<T: Foo> { inner: T::A }
fn is_send<T: Send>() {}
fn main() {
is_send::<Bar<usize>>();
}
foo.rs:15:5: 15:26 error: the trait `core::marker::Send` is not implemented for the type `<usize as Foo>::A` [E0277]
foo.rs:15 is_send::<Bar<usize>>();
^~~~~~~~~~~~~~~~~~~~~
foo.rs:15:5: 15:26 note: `<usize as Foo>::A` cannot be sent between threads safely
foo.rs:15 is_send::<Bar<usize>>();
^~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)