Change:
<ins> error: this file contains an unclosed delimiter --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:18:53 | LL | trait C{async fn new(val: T) {} |        - unclosed delimiter ... LL | |                                                     ^ error[E0670]: `async fn` is not permitted in Rust 2015 --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:6:5 | LL |     async fn create(path: impl AsRef<std::path::Path>)  { |     ^^^^^ to use `async fn`, switch to Rust 2018 or later | = help: pass `--edition 2021` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0670]: `async fn` is not permitted in Rust 2015 --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:9 | LL | trait C{async fn new(val: T) {} |         ^^^^^ to use `async fn`, switch to Rust 2018 or later | = help: pass `--edition 2021` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0706]: functions in traits cannot be declared `async` --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:9 | LL | trait C{async fn new(val: T) {} |         -----^^^^^^^^^^^^^^^^^^ |         | |         `async` because of this | = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait error[E0423]: expected function, found module `crate` --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:9:5 | LL |     crate(move || {} ).await |     ^^^^^ not a function error[E0412]: cannot find type `T` in this scope --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:27 | LL | pub struct A {} | ------------ similarly named struct `A` defined here ... LL | trait C{async fn new(val: T) {} |                           ^ help: a struct with a similar name exists: `A` warning: changes to closure capture in Rust 2021 will affect drop order --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:6:57 | LL |       async fn create(path: impl AsRef<std::path::Path>)  { |  _____________________----_____________________________-__^ | |                     |                                | | |                     |                                in Rust 2018, `path` is dropped here along with the closure, but in Rust 2021 `path` is not part of the closure | |                     in Rust 2018, this causes the closure to capture `path`, but in Rust 2021, it has no effect LL | | LL | |     ; LL | |     crate(move || {} ).await LL | |     } | |_____^ | = note: requested on the command line with `-W rust-2021-incompatible-closure-captures` = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `path` to be fully captured | LL |     async fn create(path: impl AsRef<std::path::Path>)  { let _ = &path; |                                                           ++++++++++++++ warning: changes to closure capture in Rust 2021 will affect drop order --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:30 | LL | trait C{async fn new(val: T) {} |                      ---   - ^^ |                      |     | |                      |     in Rust 2018, `val` is dropped here along with the closure, but in Rust 2021 `val` is not part of the closure |                      in Rust 2018, this causes the closure to capture `val`, but in Rust 2021, it has no effect | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> help: add a dummy let to cause `val` to be fully captured | LL | trait C{async fn new(val: T) { let _ = &val;} |                                +++++++++++++ error: aborting due to 6 previous errors; 2 warnings emitted Some errors have detailed explanations: E0412, E0423, E0670, E0706. For more information about an error, try `rustc --explain E0412`. </ins>

Discussion:
Works even with calling just - no need for a project, and does not need as a dependency in . Bug exists on 1.59, 1.60, beta and nightly. : <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
Do you have a codebase that can be shared instead? Unfortunately, it's kinda difficult to investigate this without seeing what triggered the ICE.
might be a duplicate of
I tried my hands at minimizing this, and it turned out way easier than I thought. Updated the original comment with reproduction code.
I subscribed to this thread for curiosity about ICEs on . Here's a smaller crashing program using
Managed to minimize it more:
you might be right, especially after I narrowed down the reproduction code.

<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --code reduced from <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
another example: `