forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#118948 - compiler-errors:noop, r=eholk Use the `Waker::noop` API in tests Avoids the need to duplicate this code over and over again r? eholk
- Loading branch information
Showing
5 changed files
with
41 additions
and
82 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
26 changes: 21 additions & 5 deletions
26
tests/ui/async-await/in-trait/dont-project-to-specializable-projection.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 |
---|---|---|
@@ -1,25 +1,41 @@ | ||
error[E0053]: method `foo` has an incompatible type for trait | ||
--> $DIR/dont-project-to-specializable-projection.rs:13:5 | ||
--> $DIR/dont-project-to-specializable-projection.rs:14:5 | ||
| | ||
LL | default async fn foo(_: T) -> &'static str { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found future | ||
| | ||
note: type in trait | ||
--> $DIR/dont-project-to-specializable-projection.rs:9:5 | ||
--> $DIR/dont-project-to-specializable-projection.rs:10:5 | ||
| | ||
LL | async fn foo(_: T) -> &'static str; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: expected signature `fn(_) -> impl Future<Output = &'static str>` | ||
found signature `fn(_) -> impl Future<Output = &'static str>` | ||
|
||
error: async associated function in trait cannot be specialized | ||
--> $DIR/dont-project-to-specializable-projection.rs:13:5 | ||
--> $DIR/dont-project-to-specializable-projection.rs:14:5 | ||
| | ||
LL | default async fn foo(_: T) -> &'static str { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: specialization behaves in inconsistent and surprising ways with async functions in traits, and for now is disallowed | ||
|
||
error: aborting due to 2 previous errors | ||
error[E0599]: no method named `poll` found for struct `Pin<&mut impl Future<Output = ()>>` in the current scope | ||
--> $DIR/dont-project-to-specializable-projection.rs:50:28 | ||
| | ||
LL | match fut.as_mut().poll(ctx) { | ||
| ^^^^ method not found in `Pin<&mut impl Future<Output = ()>>` | ||
--> $SRC_DIR/core/src/future/future.rs:LL:COL | ||
| | ||
= note: the method is available for `Pin<&mut impl Future<Output = ()>>` here | ||
| | ||
= help: items from traits can only be used if the trait is in scope | ||
help: the following trait is implemented but not in scope; perhaps add a `use` for it: | ||
| | ||
LL + use std::future::Future; | ||
| | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0053`. | ||
Some errors have detailed explanations: E0053, E0599. | ||
For more information about an error, try `rustc --explain E0053`. |
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