tests: Add regression test for async closures involving HRTBs I suspect the original code from rust-lang/rust#59337 had several problems. The last problem fixed that made the code compile entered `nightly-2024-02-11`. The code fails to build with `nightly-2024-02-10`: $ rustc +nightly-2024-02-10 --edition 2018 tests/ui/async-await/async-closures/unifying-function-types-involving-hrtb.rs error[E0277]: expected a `FnOnce(&u8)` closure, found `{coroutine-closure@tests/ui/async-await/async-closures/unifying-function-types-involving-hrtb.rs:31:9: 31:30}` --> tests/ui/async-await/async-closures/unifying-function-types-involving-hrtb.rs:31:9 | 31 | foo(async move | f: &u8 | { *f }); | --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce(&u8)` closure, found `{coroutine-closure@tests/ui/async-await/async-closures/unifying-function-types-involving-hrtb.rs:31:9: 31:30}` | | | required by a bound introduced by this call | (Note that you must add `#![feature(async_closure)]` to test with such old nightlies, since they are from before stabilization of async closures.) So one of the following commits made the code build: <details> <summary>git log d44e3b95cb9d4..6cc4843512d613f --no-merges --oneline</summary>4def37386cmanually bless an aarch64 test04bc624ea0rebless after rebase77f8c3caeadetect consts that reference extern statics9c0623fe8fvalidation: descend from consts into statics4e77e368ebunstably allow constants to refer to statics and read from immutable staticsa2479a4ae7Remove unnecessary `min_specialization` after bootstrap7b73e4fd44Allow restricted trait impls in macros with `min_specialization`e6f5af9671Remove unused fnfde695a2d1Add a helpful suggestiond7263d7aadChange wording973bbfbd23No more associated type bounds in dyn traitcf1096eb72Remove unnecessary `#![feature(min_specialization)]`3d4a9f5047Turn the "no saved object file in work product" ICE into a translatable fatal errorbb60ded24bLoosen an assertion to account for stashed errors.69a5264a52Move some tests4ef1790b4etidye59d9b171eAvoid a collection and iteration on empty passes8b6b9c5efcast_lowering: Fix regression in `use ::{}` imports.83f3bc4271Update jobserver-rs to 0.1.2814e0dab96bUnify item relative path computation in one functionf3c24833c5Add regression test for non local items link generationf0d002b890Correctly generate path for non-local items in source code pagesc94bbb24dbClarify that atomic and regular integers can differ in alignment7057188c54make it recursive7a63d3f16aAdd tests for untested capabilities548929dc5eDon't unnecessarily lower associated type bounds to impl trait22d582a38dFor a rigid projection, recursively look at the self type's item bounds540be28f6csort suggestions for object diagnostic9322882adeAdd a couple more tests3bb384aad6Prefer AsyncFn* over Fn* for coroutine-closuresaa6f45eb79Use `ensure` when the result of the query is not needed beyond its `Result`ness8ff1994ec0Fix whitespace issues that tidy caughtf0c6f5a7feAdd documentation on `str::starts_with`63cc3c7b8ftest `llvm_out` behaviour7fb4512ee8fix `llvm_out` to use the correct LLVM rootb8c93f1223Coroutine closures implement regular Fn traits, when possible08af64e96bRegular closures now built-in impls for AsyncFn*0dd40786b5Harmonize blanket implementations for AsyncFn* traitsf3d32f2f0cFlatten confirmation logic9a819ab8f7static mut: allow reference to arbitrary types, not just slices and arrays </details> This was probably fixed by3bb384aad6(https://github.com/rust-lang/rust/pull/120712). That PR does not have a big tests diff, so I assume the test we add does not exist elsewhere. It's hard to know for sure. Closes rust-lang/rust#59337 since we add the test from that issue. In that issue there is a [proposal](https://github.com/rust-lang/rust/issues/59337#issuecomment-826441716) for two minimized versions, but they both fail to compile with `nightly-2024-02-11`, so those reproducers are for different problem(s). ### Tracking Issue - https://github.com/rust-lang/rust/issues/62290
This is the main source code repository for Rust. It contains the compiler, standard library, and documentation.
Why Rust?
-
Performance: Fast and memory-efficient, suitable for critical services, embedded devices, and easily integrated with other languages.
-
Reliability: Our rich type system and ownership model ensure memory and thread safety, reducing bugs at compile-time.
-
Productivity: Comprehensive documentation, a compiler committed to providing great diagnostics, and advanced tooling including package manager and build tool (Cargo), auto-formatter (rustfmt), linter (Clippy) and editor support (rust-analyzer).
Quick Start
Read "Installation" from The Book.
Installing from Source
If you really want to install from source (though this is not recommended), see INSTALL.md.
Getting Help
See https://www.rust-lang.org/community for a list of chat platforms and forums.
Contributing
See CONTRIBUTING.md.
For a detailed explanation of the compiler's architecture and how to begin contributing, see the rustc-dev-guide.
License
Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.
Trademark
The Rust Foundation owns and protects the Rust and Cargo trademarks and logos (the "Rust Trademarks").
If you want to use these names or brands, please read the Rust language trademark policy.
Third-party logos may be subject to third-party copyrights and trademarks. See Licenses for details.