-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-HIRArea: The high-level intermediate representation (HIR)Area: The high-level intermediate representation (HIR)A-async-awaitArea: Async & AwaitArea: Async & AwaitA-coroutinesArea: CoroutinesArea: CoroutinesA-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.Category: This is a bug.F-coroutines`#![feature(coroutines)]``#![feature(coroutines)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
This code
fn main() {
async { yield print!(":C") };
}
produces ICE on current beta and nightly
thread 'rustc' panicked at 'src/librustc/hir/map/hir_id_validator.rs:26:
ItemLocalIds not assigned densely in ::main[0]. Max ItemLocalId = 14, missing IDs = ["[local_id: 1, node:unknown node (hir_id=HirId { owner: DefIndex(12), local_id: 1 })]"]; seens IDs = ["(HirId { owner: DefIndex(12), local_id: 0 } fn main (hir_id=HirId { owner: DefIndex(12), local_id: 0 }))", "(HirId { owner: DefIndex(12), local_id: 13 } block { ::std::future::from_generator(|| { (/*ERROR*/) }); } (hir_id=HirId { owner: DefIndex(12), local_id: 13 }))", "(HirId { owner: DefIndex(12), local_id: 10 } expr ::std::future::from_generator (hir_id=HirId { owner: DefIndex(12), local_id: 10 }))", "(HirId { owner: DefIndex(12), local_id: 7 } path segment std (hir_id=HirId { owner: DefIndex(12), local_id: 7 }))", "(HirId { owner: DefIndex(12), local_id: 4 } expr { (/*ERROR*/) } (hir_id=HirId { owner: DefIndex(12), local_id: 4 }))", "(HirId { owner: DefIndex(12), local_id: 14 } expr { ::std::future::from_generator(|| { (/*ERROR*/) }); } (hir_id=HirId { owner: DefIndex(12), local_id: 14 }))", "(HirId { owner: DefIndex(12), local_id: 11 } expr ::std::future::from_generator(|| { (/*ERROR*/) }) (hir_id=HirId { owner: DefIndex(12), local_id: 11 }))", "(HirId { owner: DefIndex(12), local_id: 8 } path segment future (hir_id=HirId { owner: DefIndex(12), local_id: 8 }))", "(HirId { owner: DefIndex(12), local_id: 5 } expr || { (/*ERROR*/) } (hir_id=HirId { owner: DefIndex(12), local_id: 5 }))", "(HirId { owner: DefIndex(12), local_id: 2 } expr (/*ERROR*/) (hir_id=HirId { owner: DefIndex(12), local_id: 2 }))", "(HirId { owner: DefIndex(12), local_id: 12 } stmt ::std::future::from_generator(|| { (/*ERROR*/) }); (hir_id=HirId { owner: DefIndex(12), local_id: 12 }))", "(HirId { owner: DefIndex(12), local_id: 9 } path segment from_generator (hir_id=HirId { owner: DefIndex(12), local_id: 9 }))", "(HirId { owner: DefIndex(12), local_id: 6 } path segment (hir_id=HirId { owner: DefIndex(12), local_id: 6 }))", "(HirId { owner: DefIndex(12), local_id: 3 } block { (/*ERROR*/) } (hir_id=HirId { owner: DefIndex(12), local_id: 3 }))"]', src/librustc/util/bug.rs:37:26
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.40.0-beta.2 (2a0ba54fa 2019-11-16) running on x86_64-apple-darwin
note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.
error: could not compile `rust-games`.
Metadata
Metadata
Assignees
Labels
A-HIRArea: The high-level intermediate representation (HIR)Area: The high-level intermediate representation (HIR)A-async-awaitArea: Async & AwaitArea: Async & AwaitA-coroutinesArea: CoroutinesArea: CoroutinesA-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.Category: This is a bug.F-coroutines`#![feature(coroutines)]``#![feature(coroutines)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
nikomatsakis commentedon Dec 10, 2019
Tagging as P-medium and "triaged" for async-await.
Note that yield is unstable.
estebank commentedon Dec 11, 2019
@Centril the feature is nightly but the ice doesn't require any feature gate to trigger.
chrissimpkins commentedon Feb 10, 2020
Regression found in the compiler
searched nightlies: from nightly-2019-01-01 to nightly-2020-02-01
regressed nightly: nightly-2019-09-29
searched commits: from 084beb8 to 488381c
regressed commit: f3c8eba
source code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=956b959a5649adaecb4fe39acef8239d
Instructions
Error
COLLAPSIBLE ERROR STACKTRACE
nikomatsakis commentedon Feb 14, 2020
@chrissimpkins thanks for the bisection!
Annoyingly, it regressed in a rollup PR, which means there are many candidates:
target_feature
on constants #64809 (hir: Disallowtarget_feature
on constants) -- ❌.abort_if_errors()
#64830 (Thou shallt not.abort_if_errors()
) -- 🎯let A = 2;
withconst A: i32 = 3
#64859 (check_match: improve diagnostics forlet A = 2;
withconst A: i32 = 3
) -- ❓nikomatsakis commentedon Feb 14, 2020
If I had to guess, I would guess #64830 (cc @estebank) triggered this regression, but #64859 or #64802 are possibilities. I would guess #64830 because it caused the compiler to keep compiling when it might've aborted, and maybe it would've aborted in these cases and hence never reached the code that causes an ICE.
If indeed I am correct, then this could be fixed by adding a
delay_span_bug
call at the point of the ICE (i.e., basically asserting that some error has occurred but otherwise just try to not crash).yield
insideasync
block #69175Rollup merge of rust-lang#69175 - estebank:shall-not-ice, r=petrochenkov
Rollup merge of rust-lang#69175 - estebank:shall-not-ice, r=petrochenkov
Rollup merge of rust-lang#69175 - estebank:shall-not-ice, r=petrochenkov
Rollup merge of rust-lang#69175 - estebank:shall-not-ice, r=petrochenkov