2022-11-09 14:19:31 -06:00
// edition: 2021
2023-06-14 00:20:31 -05:00
// revisions: mismatch mismatch_async too_many too_few lt
2022-11-09 14:19:31 -06:00
#![ feature(return_position_impl_trait_in_trait, async_fn_in_trait) ]
#![ allow(incomplete_features) ]
2023-06-14 00:20:31 -05:00
#[ cfg(mismatch) ]
2022-11-09 14:19:31 -06:00
trait Uwu {
fn owo ( x : ( ) ) -> impl Sized ;
}
2023-06-14 00:20:31 -05:00
#[ cfg(mismatch) ]
2022-11-09 14:19:31 -06:00
impl Uwu for ( ) {
fn owo ( _ : u8 ) { }
2023-06-14 00:20:31 -05:00
//[mismatch]~^ ERROR method `owo` has an incompatible type for trait
2022-11-09 14:19:31 -06:00
}
2023-06-14 00:20:31 -05:00
#[ cfg(mismatch_async) ]
2022-11-09 14:19:31 -06:00
trait AsyncUwu {
async fn owo ( x : ( ) ) { }
}
2023-06-14 00:20:31 -05:00
#[ cfg(mismatch_async) ]
2022-11-09 14:19:31 -06:00
impl AsyncUwu for ( ) {
async fn owo ( _ : u8 ) { }
2023-06-14 00:20:31 -05:00
//[mismatch_async]~^ ERROR method `owo` has an incompatible type for trait
2022-11-09 14:19:31 -06:00
}
2023-06-14 00:20:31 -05:00
#[ cfg(too_many) ]
2022-11-09 14:19:31 -06:00
trait TooMuch {
fn calm_down_please ( ) -> impl Sized ;
}
2023-06-14 00:20:31 -05:00
#[ cfg(too_many) ]
2022-11-09 14:19:31 -06:00
impl TooMuch for ( ) {
fn calm_down_please ( _ : ( ) , _ : ( ) , _ : ( ) ) { }
2023-06-14 00:20:31 -05:00
//[too_many]~^ ERROR method `calm_down_please` has 3 parameters but the declaration in trait `TooMuch::calm_down_please` has 0
2022-11-09 14:19:31 -06:00
}
2023-06-14 00:20:31 -05:00
#[ cfg(too_few) ]
2022-11-09 14:19:31 -06:00
trait TooLittle {
fn come_on_a_little_more_effort ( _ : ( ) , _ : ( ) , _ : ( ) ) -> impl Sized ;
}
2023-06-14 00:20:31 -05:00
#[ cfg(too_few) ]
2022-11-09 14:19:31 -06:00
impl TooLittle for ( ) {
fn come_on_a_little_more_effort ( ) { }
2023-06-14 00:20:31 -05:00
//[too_few]~^ ERROR method `come_on_a_little_more_effort` has 0 parameters but the declaration in trait `TooLittle::come_on_a_little_more_effort` has 3
2022-11-09 14:19:31 -06:00
}
2023-06-14 00:20:31 -05:00
#[ cfg(lt) ]
2022-11-09 14:19:31 -06:00
trait Lifetimes {
fn early < ' early , T > ( x : & ' early T ) -> impl Sized ;
}
2023-06-14 00:20:31 -05:00
#[ cfg(lt) ]
2022-11-09 14:19:31 -06:00
impl Lifetimes for ( ) {
fn early < ' late , T > ( _ : & ' late ( ) ) { }
2023-06-14 00:20:31 -05:00
//[lt]~^ ERROR method `early` has an incompatible type for trait
2022-11-09 14:19:31 -06:00
}
fn main ( ) { }