Support RTN on associated methods from supertraits
This commit is contained in:
parent
82cd953c7c
commit
20a83144b2
9 changed files with 115 additions and 31 deletions
|
|
@ -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() {}
|
||||
|
|
|
|||
|
|
@ -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>>() {}
|
||||
|
|
|
|||
|
|
@ -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::<()>();
|
||||
}
|
||||
|
|
@ -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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue