-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
531be74
commit ad392ff
Showing
4 changed files
with
53 additions
and
3 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
22 changes: 22 additions & 0 deletions
22
tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr
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 @@ | ||
warning: impl trait in impl method signature does not match trait method signature | ||
--> $DIR/async-example-desugared-boxed.rs:14:22 | ||
| | ||
LL | async fn foo(&self) -> i32; | ||
| --------------------------- return type from trait method defined here | ||
... | ||
LL | fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate | ||
note: the lint level is defined here | ||
--> $DIR/async-example-desugared-boxed.rs:13:12 | ||
| | ||
LL | #[warn(refining_impl_trait)] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
help: replace the return type so that it matches the trait | ||
| | ||
LL | fn foo(&self) -> impl Future<Output = i32> { | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
warning: 1 warning emitted | ||
|
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
22 changes: 22 additions & 0 deletions
22
tests/ui/async-await/in-trait/async-example-desugared-manual.stderr
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 @@ | ||
warning: impl trait in impl method signature does not match trait method signature | ||
--> $DIR/async-example-desugared-manual.rs:22:22 | ||
| | ||
LL | async fn foo(&self) -> i32; | ||
| --------------------------- return type from trait method defined here | ||
... | ||
LL | fn foo(&self) -> MyFuture { | ||
| ^^^^^^^^ | ||
| | ||
= note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate | ||
note: the lint level is defined here | ||
--> $DIR/async-example-desugared-manual.rs:21:12 | ||
| | ||
LL | #[warn(refining_impl_trait)] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
help: replace the return type so that it matches the trait | ||
| | ||
LL | fn foo(&self) -> impl Future<Output = i32> { | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
warning: 1 warning emitted | ||
|