Support RTN on associated methods from supertraits

This commit is contained in:
Michael Goulet 2023-05-03 19:39:57 +00:00
parent 82cd953c7c
commit 20a83144b2
9 changed files with 115 additions and 31 deletions

View file

@ -8,6 +8,6 @@ trait Trait {
}
fn bar<T: Trait<methid(): Send>>() {}
//~^ ERROR cannot find associated function `methid` in trait `Trait`
//~^ ERROR cannot find associated function `methid` for `Trait`
fn main() {}

View file

@ -7,7 +7,7 @@ LL | #![feature(return_type_notation, async_fn_in_trait)]
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
= note: `#[warn(incomplete_features)]` on by default
error: cannot find associated function `methid` in trait `Trait`
error: cannot find associated function `methid` for `Trait`
--> $DIR/missing.rs:10:17
|
LL | fn bar<T: Trait<methid(): Send>>() {}

View file

@ -0,0 +1,25 @@
// edition:2021
// check-pass
#![feature(async_fn_in_trait, return_type_notation)]
//~^ WARN the feature `return_type_notation` is incomplete
trait Super<'a> {
async fn test();
}
impl Super<'_> for () {
async fn test() {}
}
trait Foo: for<'a> Super<'a> {}
impl Foo for () {}
fn test<T>()
where
T: Foo<test(): Send>,
{
}
fn main() {
test::<()>();
}

View file

@ -0,0 +1,11 @@
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/super-method-bound.rs:4:31
|
LL | #![feature(async_fn_in_trait, return_type_notation)]
| ^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
= note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted