-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken MIR with const_generics and async/await #84737
Comments
Looks like someone used the wrong variable in one of the two places |
I also meet this problem but was unable to reproduce it. The compiler complains about
But here
In this cause It seems like this problem is because the generator is trying to find a type with a concrete name, but there are different corresponding name in MIR. |
Minimised to: #![allow(incomplete_features)]
#![feature(const_generics)]
async fn test(test: [(); { 0 }]) {
let _ = &test;
async {}.await;
} Interestingly, removing the braces around the 0 allows it to compile fine. Regression bisected to: 2021-03-28 9b0edb7 bisected with cargo-bisect-rustc v0.6.0Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --preserve --start=2021-02-06 --end=2021-04-24 Best guess is that it's an effect of: #81351 |
In my case, I found out that it only breaks with |
When it is surrounded by {} it evaluates it, which as shown above is finding two separate symbols that don't match (that's what this issue is for) |
Issue: rust-lang/rust#84737
Issue: rust-lang/rust#84737
…-const-expr, r=oli-obk Normalize generator-local types with unevaluated constants Normalize generator-interior types in addition to (i.e. instead of just) erasing regions, since sometimes we collect types with unevaluated const exprs. Fixes rust-lang#84737 Fixes rust-lang#88171 Fixes rust-lang#92091 Fixes rust-lang#92634 Probably also fixes rust-lang#73114, but that one has no code I could test. It looks like it's the same issue, though.
Reproduced in 4 different builds on 2 different repos with nightly 17d29dc 2022-01-21. I am not sure if this is the same issue. https://github.com/SOF3/bthint/runs/4904869466 Although the crash message says clippy, it seems to be a problem from the rustc code. Should I create a new issue? |
@SOF3 That looks like a separate issue to me, so please do open a new issue (feel free to point back at this one as something similar). |
Seems no longer reproduced on latest nightly, not sure if it is some update in the libraries or the rustc itself. |
Explanation
This error will surface if the
test
arg has been accessed at least once(i did this withprintln!
) and if there is an async function that is awaited in the body. If I remove the await fortest_async_fn
it will run as normal. This error happened while I was using actix-web so I reproduced the simplest version of my code.Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: