-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-inferenceArea: Type inferenceArea: Type inferenceC-bugCategory: This is a bug.Category: This is a bug.F-negative_impls#![feature(negative_impls)]#![feature(negative_impls)]requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
#![feature(negative_impls)]
struct Foo<T>(T);
impl !Send for Foo<()> {}
fn test<T>() -> T where Foo<T>: Send { todo!() }
fn main() {
let _: u8 = test();
}
Fails with
error[E0277]: `Foo<_>` cannot be sent between threads safely
--> $DIR/fk.rs:10:17
|
LL | fn test<T>() -> T where Foo<T>: Send { todo!() }
| ---- required by this bound in `test`
...
LL | let _: u8 = test();
| ^^^^ `Foo<_>` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `Foo<_>`
Explicitly specifying test::<u8>()
works though.
Metadata
Metadata
Assignees
Labels
A-inferenceArea: Type inferenceArea: Type inferenceC-bugCategory: This is a bug.Category: This is a bug.F-negative_impls#![feature(negative_impls)]#![feature(negative_impls)]requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.