Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Regression test for <https://github.com/rust-lang/rust/issues/151299>.
// An invalid `impl Future` awaited inside a nested async block used to ICE with
// "Failed to normalize" in normalize_erasing_regions.
//@ edition: 2024
//@ compile-flags: -Zvalidate-mir -Znext-solver=globally

fn invalid_future() -> impl Future {}
//~^ ERROR `()` is not a future

fn create_complex_future() -> impl Future {
async { &|| async { invalid_future().await } }
}

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0277]: `()` is not a future
--> $DIR/normalize-erased-closure-in-async-151299.rs:7:24
|
LL | fn invalid_future() -> impl Future {}
| ^^^^^^^^^^^ `()` is not a future
|
= help: the trait `Future` is not implemented for `()`

error: aborting due to 1 previous error

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