-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggest correct signature on missing fn returning RPITIT/AFIT
- Loading branch information
1 parent
2ca8d35
commit dbee24d
Showing
4 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// edition:2021 | ||
// run-rustfix | ||
|
||
#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)] | ||
|
||
trait Trait { | ||
async fn foo(); | ||
|
||
async fn bar() -> i32; | ||
|
||
fn test(&self) -> impl Sized + '_; | ||
} | ||
|
||
struct S; | ||
|
||
impl Trait for S {fn test(&self) -> impl Sized + '_ { todo!() } | ||
async fn bar() -> i32 { todo!() } | ||
async fn foo() { todo!() } | ||
} | ||
//~^ ERROR not all trait items implemented | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// edition:2021 | ||
// run-rustfix | ||
|
||
#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)] | ||
|
||
trait Trait { | ||
async fn foo(); | ||
|
||
async fn bar() -> i32; | ||
|
||
fn test(&self) -> impl Sized + '_; | ||
} | ||
|
||
struct S; | ||
|
||
impl Trait for S {} | ||
//~^ ERROR not all trait items implemented | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
error[E0046]: not all trait items implemented, missing: `foo`, `bar`, `test` | ||
--> $DIR/suggest-missing-item.rs:16:1 | ||
| | ||
LL | async fn foo(); | ||
| --------------- `foo` from trait | ||
LL | | ||
LL | async fn bar() -> i32; | ||
| ---------------------- `bar` from trait | ||
LL | | ||
LL | fn test(&self) -> impl Sized + '_; | ||
| ---------------------------------- `test` from trait | ||
... | ||
LL | impl Trait for S {} | ||
| ^^^^^^^^^^^^^^^^ missing `foo`, `bar`, `test` in implementation | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0046`. |