Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions tests/ui/iterators/iter-macro-not-async-closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
// explanation is moved to the `help` instead of the span label.
//
//@ edition: 2024
//@ revisions: narrow wide
//@[narrow] compile-flags: --diagnostic-width=20
//@[wide] compile-flags: --diagnostic-width=300
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks almost like the test intentionally wants to cover different widths?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Yes, I'm just checking if the original version of the test passes without manually specifying diag width, since it failed in CI but not locally)

//@ remap-src-base

#![feature(yield_expr, iter_macro)]

Expand All @@ -31,8 +29,8 @@ fn main() {

let x = pin!(call_async_once(f));
//~^ ERROR AsyncFnOnce()` is not satisfied
//~^^ ERROR AsyncFnOnce()` is not satisfied
//~^^^ ERROR AsyncFnOnce()` is not satisfied
//~| ERROR AsyncFnOnce()` is not satisfied
//~| ERROR AsyncFnOnce()` is not satisfied
x.poll(&mut Context::from_waker(Waker::noop()));
//~^ ERROR AsyncFnOnce()` is not satisfied
}
54 changes: 54 additions & 0 deletions tests/ui/iterators/iter-macro-not-async-closure.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
error[E0277]: the trait bound `{gen closure@$DIR/iter-macro-not-async-closure.rs:24:21: 24:28}: AsyncFnOnce()` is not satisfied
--> $DIR/iter-macro-not-async-closure.rs:30:34
|
LL | let x = pin!(call_async_once(f));
| --------------- ^ the trait `AsyncFnOnce()` is not implemented for `{gen closure@$DIR/iter-macro-not-async-closure.rs:24:21: 24:28}`
| |
| required by a bound introduced by this call
|
note: required by a bound in `call_async_once`
--> $DIR/iter-macro-not-async-closure.rs:19:34
|
LL | async fn call_async_once(f: impl AsyncFnOnce()) {
| ^^^^^^^^^^^^^ required by this bound in `call_async_once`

error[E0277]: the trait bound `{gen closure@$DIR/iter-macro-not-async-closure.rs:24:21: 24:28}: AsyncFnOnce()` is not satisfied
--> $DIR/iter-macro-not-async-closure.rs:30:18
|
LL | let x = pin!(call_async_once(f));
| ^^^^^^^^^^^^^^^^^^ the trait `AsyncFnOnce()` is not implemented for `{gen closure@$DIR/iter-macro-not-async-closure.rs:24:21: 24:28}`
|
note: required by a bound in `call_async_once`
--> $DIR/iter-macro-not-async-closure.rs:19:34
|
LL | async fn call_async_once(f: impl AsyncFnOnce()) {
| ^^^^^^^^^^^^^ required by this bound in `call_async_once`

error[E0277]: the trait bound `{gen closure@$DIR/iter-macro-not-async-closure.rs:24:21: 24:28}: AsyncFnOnce()` is not satisfied
--> $DIR/iter-macro-not-async-closure.rs:30:13
|
LL | let x = pin!(call_async_once(f));
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsyncFnOnce()` is not implemented for `{gen closure@$DIR/iter-macro-not-async-closure.rs:24:21: 24:28}`
|
note: required by a bound in `call_async_once`
--> $DIR/iter-macro-not-async-closure.rs:19:34
|
LL | async fn call_async_once(f: impl AsyncFnOnce()) {
| ^^^^^^^^^^^^^ required by this bound in `call_async_once`
= note: this error originates in the macro `pin` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `{gen closure@$DIR/iter-macro-not-async-closure.rs:24:21: 24:28}: AsyncFnOnce()` is not satisfied
--> $DIR/iter-macro-not-async-closure.rs:34:5
|
LL | x.poll(&mut Context::from_waker(Waker::noop()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsyncFnOnce()` is not implemented for `{gen closure@$DIR/iter-macro-not-async-closure.rs:24:21: 24:28}`
|
note: required by a bound in `call_async_once`
--> $DIR/iter-macro-not-async-closure.rs:19:34
|
LL | async fn call_async_once(f: impl AsyncFnOnce()) {
| ^^^^^^^^^^^^^ required by this bound in `call_async_once`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0277`.
Loading