trait NotImplemented { }
-trait MyTrait
+trait MyTrait: Sized
where Option<Self> : NotImplemented
{}
impl MyTrait for .. {}
fn foo<T:MyTrait>() {
- bar::<Option<T>>()
//~^ ERROR the trait `NotImplemented` is not implemented for the type `core::option::Option<T>`
- //
// This should probably typecheck. This is #20671.
}
fn bar<T:NotImplemented>() { }
-fn test() {
- bar::<Option<i32>>();
- //~^ ERROR the trait `NotImplemented` is not implemented for the type `core::option::Option<i32>`
-}
-
fn main() {
- foo::<u32>();
- //~^ ERROR the trait `NotImplemented` is not implemented for the type `core::option::Option<u32>`
}