FWIW, also fails on stable 1.70 and 1.60, sometimes with error output about the recursion limit, but always hangs in the versions I tried.
Error output
<no output given by cargo, hangs until OOM killed>
Using -Ztrait-solver=next
Fixed when using -Ztrait-solver=next on nightly (2023-11-15 shown above), as it reports an error correctly.
Posting this issue because I'm not sure how soon that "next" trait solver will become the default (e.g. for stable).
$ RUSTFLAGS="-Ztrait-solver=next" cargo c
+ command cargo c
Checking ice_117999 v0.1.0 (/home/user/ice_117999)
error[E0275]: overflow evaluating the requirement `<impl Future<Output = Result<(), ()>> as Future>::Output == Result<(), <MyStruct<'a> as HasError>::Error>`
--> src/lib.rs:38:5
|
38 | async fn foo() -> Result<(), ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`ice_117999`)
note: required by a bound in `Foo::{opaque#0}`
--> src/lib.rs:18:5
|
18 | async fn foo() -> Result<(), Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Foo::{opaque#0}`
For more information about this error, try `rustc --explain E0275`.
error: could not compile `ice_117999` (lib) due to previous error
Backtrace - not available, since rustc hangs until OOM killed
Code
Playground, with more comments
Meta
rustc --version --verbose
:FWIW, also fails on stable 1.70 and 1.60, sometimes with error output about the recursion limit, but always hangs in the versions I tried.
Error output
Using
-Ztrait-solver=next
Fixed when using
-Ztrait-solver=next
on nightly (2023-11-15 shown above), as it reports an error correctly. Posting this issue because I'm not sure how soon that "next" trait solver will become the default (e.g. for stable).Backtrace - not available, since rustc hangs until OOM killed