• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // edition:2018
2 // [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
3 // revisions: current next
4 
5 #![feature(async_fn_in_trait)]
6 #![feature(min_specialization)]
7 
8 struct MyStruct;
9 
10 trait MyTrait<T> {
foo(_: T) -> &'static str11     async fn foo(_: T) -> &'static str;
12 }
13 
14 impl<T> MyTrait<T> for MyStruct {}
15 //~^ ERROR: not all trait items implemented, missing: `foo` [E0046]
16 
17 impl MyTrait<i32> for MyStruct {
foo(_: i32) -> &'static str18     async fn foo(_: i32) -> &'static str {}
19     //~^ ERROR: `foo` specializes an item from a parent `impl`, but that item is not marked `default` [E0520]
20     //~| ERROR: mismatched types [E0308]
21 }
22 
main()23 fn main() {}
24