Skip to content
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 on beta and nightly as result of use of `yield` in combination with macro call in `async` block #67158

Open
olegnn opened this issue Dec 8, 2019 · 2 comments

Comments

@olegnn
Copy link
Contributor

@olegnn olegnn commented Dec 8, 2019

This code

fn main() {
    async { yield print!(":C") };
}

(Playground)

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`.
@nikomatsakis

This comment has been minimized.

Copy link
Contributor

@nikomatsakis nikomatsakis commented Dec 10, 2019

Tagging as P-medium and "triaged" for async-await.

Note that yield is unstable.

@estebank

This comment has been minimized.

Copy link
Contributor

@estebank estebank commented Dec 11, 2019

@Centril the feature is nightly but the ice doesn't require any feature gate to trigger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.