-
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
ICE: src/librustc/middle/region.rs:1037: Encountered greater count 28 #69307
Comments
T-compiler triage: P-high. Leaving nomination label in place, since I don't want to disrupt WG-async-await workflow. |
This does already ICE on 1.39.0 |
I could further simplify the code as: use tokio::runtime::Runtime;
fn main() {
let mut rt = Runtime::new().unwrap();
let mut sum = 0;
sum += rt.block_on(async {
(async { }).await;
1
});
}
|
However, this code does not cause ICE: use tokio::runtime::Runtime;
fn main() {
let mut rt = Runtime::new().unwrap();
let mut sum = 0;
sum = sum + rt.block_on(async {
(async { }).await;
1
});
} |
If you can reproduce this without depending on tokio that would be great. |
How abot this? use futures::executor::block_on;
fn main() {
let mut sum = 0;
sum += block_on(async {
(async { }).await;
1
});
}
|
Minimized: fn block_on<F>(_: F) -> usize {
0
}
fn main() {
let mut sum = 0;
sum += block_on(async {
(async {}).await;
1
});
} |
Discussed in T-compiler meeting. Keeping as P-high but removing nomination. |
OK so I've been investigating this a bit. I am not quite able to write-up mentoring instructions yet because I don't really understand what's going on, but I can leave a few notes. First off, the ICE occurs in the code that is attempting to approximate what values may be live across an fn block_on<F>(_: F) -> usize {
0
}
fn main() {
let mut sum = 0;
sum += block_on(async {
bar().await;
});
}
async fn bar() { } The ICE occurs in this match arm: rust/src/librustc_passes/region.rs Line 342 in 2dcf54f
It appears to be related to some logic that is attempting to figure out a "worst case" execution order for rust/src/librustc_passes/region.rs Lines 351 to 355 in 2dcf54f
I confess I don't quite follow this logic anymore, but the problem has to do with entering a distinct async block. This code for example does not trigger the failure: async fn bar() {
let mut sum = 0;
sum += block_on(async {
baz().await;
});
}
async fn baz() {
} |
Ah, I think maybe I see the problem here actually -- I suspect the problem is that we need to clear (and then restore) the |
Code
Playground Link
Meta
rustc --version --verbose
:Same issue still exists in
rustc +beta --version --verbose
:and also in
rustc +nightly --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: