-
Notifications
You must be signed in to change notification settings - Fork 13.4k
infinite recursion ICE #52701
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
Comments
A slighty more interesting example might be this: fn rec() -> *const impl Copy {
// This should *NEVER* run, but just to trigger the recursion
if false {
rec()
} else {
0u8 as *const _ // cast is needed to make compiler happy about the types
}
}
fn main() {
rec();
} As far as I know, in this example the type that implements Copy is the u8, however it is being cast to...something |
With the 2018's However when inserting an #![feature(futures_api)]
#![feature(async_await)]
#![feature(await_macro)]
use std::future::Future;
async fn rec() -> impl Future { await!(rec()) }
fn main() {
rec();
} |
as of 1.28, this also ICE's on stable: Backtrace:
|
I can see how this happen - the compiler working hard to find a type to wrap with |
Where's the ICE? All I'm seeing is an error - you have a cyclic dependency in types. EDIT: oh, the ICE is hidden in the backtrace, it's this (I'll also edit the issue description): error: internal compiler error: librustc\traits\query\normalize.rs:124: infinite recursion generic_ty: impl std::ops::Fn<()>, substs: [], concrete_ty: impl std::ops::Fn<()>, ty: impl std::ops::Fn<()> |
discussed at meeting. P-high. Assigning to @nikomatsakis |
visited for triage. I might work-steal this. |
Did some bisection. Unfortunately we don't have nightlies from nightly-2018-08-{20,21,22,23}-x86_64-unknown-linux-gnu... But the ICE replicates with nightly-2018-08-19-x86_64-unknown-linux-gnu, and goes away with nightly-2018-08-24-x86_64-unknown-linux-gnu: More complete transcript in details block:
|
And in this details block is the
�[33mcommit 63d6649�[m
�[33mcommit cd8fcb6�[m
�[33mcommit 5ce5e08�[m
�[33mcommit 54d82d0�[m
�[33mcommit e5284b0�[m
�[33mcommit 65c0ebd�[m
�[33mcommit 35bf1ae�[m
�[33mcommit 827e57c�[m
�[33mcommit 4d81fe9�[m
�[33mcommit c648b0b�[m
�[33mcommit e73077e�[m
�[33mcommit 7440125�[m
�[33mcommit 3045ffa�[m
�[33mcommit b34503e�[m
�[33mcommit 917945d�[m
�[33mcommit f1b506a�[m
�[33mcommit b75b047�[m
�[33mcommit bd6ae6a�[m
�[33mcommit bb78426�[m
�[33mcommit f012b4c�[m
�[33mcommit 4f78a2d�[m
�[33mcommit ef4b2ed�[m
�[33mcommit 95bdc65�[m
�[33mcommit e53a575�[m
�[33mcommit 3d8e760�[m
�[33mcommit 4fa4bb5�[m
�[33mcommit 55d9823�[m
�[33mcommit da86fbd�[m
�[33mcommit 8255f9e�[m
�[33mcommit c24f27c�[m
�[33mcommit 71722b9�[m
�[33mcommit d0209c4�[m
�[33mcommit 05cfb3f�[m
�[33mcommit 08f3685�[m
�[33mcommit 8a5dccd�[m
�[33mcommit 04fa5d3�[m
�[33mcommit 6f637da�[m
�[33mcommit d37cee3�[m
�[33mcommit 87c7e57�[m
�[33mcommit 3d5fef6�[m
�[33mcommit 329dde5�[m
�[33mcommit f8d5ed4�[m
�[33mcommit b85e4cc�[m
�[33mcommit 674ef66�[m
�[33mcommit 4fec615�[m
�[33mcommit 899bc14�[m
�[33mcommit 14dc780�[m
�[33mcommit f3e7efc�[m
�[33mcommit 128c634�[m
�[33mcommit 54c81ac�[m
�[33mcommit 8ad4047�[m
�[33mcommit c3d392f�[m
�[33mcommit 49999e9�[m
�[33mcommit 42a1239�[m
�[33mcommit e3b4f8e�[m
�[33mcommit 0b8c691�[m
�[33mcommit 956b51f�[m
�[33mcommit 6f5cf12�[m
�[33mcommit ad8deba�[m
�[33mcommit 5099933�[m
�[33mcommit 71a1ef1�[m
�[33mcommit 241b9b4�[m
�[33mcommit f2aeb5b�[m
�[33mcommit aa760a5�[m
�[33mcommit b1df2ae�[m
�[33mcommit 730098b�[m
�[33mcommit ad009ae�[m
�[33mcommit 23d86b0�[m
�[33mcommit 61e7ba1�[m
�[33mcommit e314a4e�[m
�[33mcommit 1e137a7�[m
�[33mcommit 09b15e9�[m
�[33mcommit e860ab2�[m
�[33mcommit 0807ad1�[m
�[33mcommit 689c711�[m
�[33mcommit 7483ea8�[m
�[33mcommit ad2de8b�[m
�[33mcommit 24bc544�[m
�[33mcommit 7d4f5f7�[m
�[33mcommit 786ccc3�[m
�[33mcommit cf1b6d6�[m
�[33mcommit a79cffb�[m
�[33mcommit 6971c5d�[m
�[33mcommit 1cbf339�[m
�[33mcommit dec5563�[m
�[33mcommit e67bba8�[m
�[33mcommit d0d81b7�[m
�[33mcommit 6a957e1�[m
�[33mcommit 2d6d3ac�[m
�[33mcommit 18f41e5�[m
�[33mcommit 9f9f2c0�[m
�[33mcommit e3887e6�[m
�[33mcommit 0dd88c9�[m
�[33mcommit a9d4967�[m
�[33mcommit 6e24868�[m
�[33mcommit 9bbab65�[m
�[33mcommit dc8e9fb�[m
�[33mcommit fed4298�[m
�[33mcommit 7896ac3�[m
�[33mcommit 4457180�[m
�[33mcommit b5519db�[m
�[33mcommit 0834a1a�[m
�[33mcommit 5d4a25d�[m
�[33mcommit c980ba7�[m
�[33mcommit 2a0d720�[m
�[33mcommit b21e956�[m
�[33mcommit f9e3af7�[m
�[33mcommit c0636ab�[m
�[33mcommit 70c33bb�[m
�[33mcommit 1695856�[m
�[33mcommit 61b6363�[m
�[33mcommit 05d19fb�[m
�[33mcommit c421af9�[m
�[33mcommit 6e8a625�[m
�[33mcommit 87463c3�[m
�[33mcommit 82619ea�[m
�[33mcommit 6b597ce�[m
�[33mcommit e221fcc�[m
�[33mcommit c2788a8�[m
�[33mcommit 23e9a1d�[m
�[33mcommit 3a44ee6�[m
�[33mcommit 0447b50�[m
�[33mcommit 5bf2ad3�[m
�[33mcommit ffde96c�[m
�[33mcommit fa3d56a�[m
�[33mcommit b51723a�[m
�[33mcommit de35b66�[m
�[33mcommit 1558ae7�[m
�[33mcommit ee9bd0f�[m
�[33mcommit aa3b5c5�[m
�[33mcommit 79a905e�[m
�[33mcommit 0dd10af�[m
�[33mcommit 993fb93�[m
�[33mcommit bf1e461�[m
�[33mcommit 5a23a0d�[m
�[33mcommit 86641d9�[m
�[33mcommit 9d54bf8�[m
�[33mcommit 758239c�[m
�[33mcommit 0b83914�[m
�[33mcommit e7e9f2e�[m
�[33mcommit ab8dfbc�[m
�[33mcommit 04b50e2�[m
�[33mcommit 7e5a2b2�[m
�[33mcommit d2048b6�[m
�[33mcommit 0095471�[m
�[33mcommit 7e8825b�[m
�[33mcommit e428085�[m
�[33mcommit 5cf387c�[m
�[33mcommit 9f683be�[m
�[33mcommit 817efc2�[m
�[33mcommit 91967a8�[m
�[33mcommit ef19886�[m
�[33mcommit 9e64ce1�[m
�[33mcommit ae81fc6�[m
�[33mcommit 1c90609�[m
�[33mcommit f2445fb�[m
�[33mcommit 6bf6d50�[m
�[33mcommit b5c2470�[m
�[33mcommit 798b9ff�[m
�[33mcommit a6f4ae8�[m
�[33mcommit 25b6267�[m
�[33mcommit 7b47fd7�[m
�[33mcommit f28f648�[m
�[33mcommit 6138c82�[m
�[33mcommit a2ff845�[m
�[33mcommit 062bfbf�[m
�[33mcommit d3fe97f�[m
�[33mcommit 82607d2�[m
�[33mcommit cbd0595�[m
�[33mcommit d6dcbcd�[m
�[33mcommit c655473�[m
�[33mcommit b7772e6�[m
�[33mcommit 4722744�[m
�[33mcommit 03c4628�[m
�[33mcommit 04d33bb�[m
�[33mcommit 68b0e7d�[m
�[33mcommit 49c4573�[m
�[33mcommit a14bc71�[m
�[33mcommit 7c9f7c2�[m
�[33mcommit 9d3d4b1�[m
�[33mcommit 6a96cf1�[m
�[33mcommit e79bc41�[m
�[33mcommit ccef306�[m
�[33mcommit b524991�[m
�[33mcommit 5d07db4�[m
�[33mcommit 08d49a6�[m
�[33mcommit 5f2588f�[m
�[33mcommit db94efa�[m
�[33mcommit 9bb40b0�[m
�[33mcommit 9cfe92c�[m
�[33mcommit e02642d�[m
�[33mcommit 340a7fc�[m
�[33mcommit 35ddd46�[m
�[33mcommit 84edc0a�[m
�[33mcommit b6eef18�[m
�[33mcommit d8ba103�[m
�[33mcommit d5e24dc�[m
�[33mcommit 734ce4a�[m
�[33mcommit 3357702�[m
�[33mcommit 88d5b2f�[m
�[33mcommit c9941a8�[m
�[33mcommit e812b55�[m
�[33mcommit 96379e1�[m
�[33mcommit 5fe9aeb�[m
�[33mcommit d1a82af�[m
�[33mcommit 2317abd�[m
�[33mcommit 651215e�[m
�[33mcommit 11adc13�[m
�[33mcommit 3ac79c7�[m
�[33mcommit f84ec02�[m
�[33mcommit 71187b7�[m
�[33mcommit c2217b7�[m
�[33mcommit 8208c77�[m
�[33mcommit 08b1d83�[m
�[33mcommit 00920c0�[m
�[33mcommit 71120ef�[m
�[33mcommit bfc3b20�[m
�[33mcommit 58e4b54�[m
�[33mcommit 4e50c5b�[m
�[33mcommit 78e987a�[m
�[33mcommit a8a982b�[m
�[33mcommit 85b92c1�[m
�[33mcommit b355906�[m
�[33mcommit 99bba34�[m
�[33mcommit 98e4cd5�[m
�[33mcommit 8928de7�[m
�[33mcommit c8ef8b6�[m
�[33mcommit c488d59�[m
�[33mcommit 6e15e7c�[m
�[33mcommit a0c422a�[m
�[33mcommit 438edc3�[m
�[33mcommit c72e87e�[m
�[33mcommit 800f2c1�[m
�[33mcommit e2b95cb�[m
�[33mcommit 7f05304�[m
�[33mcommit cd0476a�[m
�[33mcommit 9f0168a�[m
�[33mcommit d6426e8�[m
�[33mcommit 73b5c7e�[m
�[33mcommit a9fe312�[m
�[33mcommit 4bbedd7�[m
�[33mcommit 14aed81�[m
�[33mcommit cafeb6f�[m
�[33mcommit 27390fc�[m
�[33mcommit 750e72b�[m
�[33mcommit d52047f�[m
�[33mcommit 6ae915b�[m
�[33mcommit c37787e�[m
�[33mcommit 1540e8c�[m
�[33mcommit a50f29a�[m
�[33mcommit 0383539�[m
�[33mcommit 1dbc781�[m
�[33mcommit e9c8361�[m
�[33mcommit 527cccb�[m
�[33mcommit 9e9e023�[m
�[33mcommit 400cb14�[m
�[33mcommit 99754ad�[m
�[33mcommit bfc8ce3�[m
�[33mcommit 5959a35�[m
�[33mcommit 4aa929c�[m
�[33mcommit bfc0807�[m
�[33mcommit af366b0�[m
�[33mcommit 25ba911�[m
�[33mcommit 07064de�[m
�[33mcommit d27c21c�[m
�[33mcommit 6c21a03�[m
�[33mcommit 732d638�[m
�[33mcommit 1aa7494�[m
�[33mcommit 72cc4bd�[m
�[33mcommit be12b24�[m
�[33mcommit 97a032e�[m
�[33mcommit c388c11�[m
�[33mcommit effb3d0�[m
�[33mcommit a9f2c5a�[m
�[33mcommit f4af3b0�[m
�[33mcommit 8389972�[m
�[33mcommit a553fa7�[m
�[33mcommit 7695bd0�[m
�[33mcommit c00fd8f�[m
�[33mcommit 7f72030�[m
�[33mcommit a20cb10�[m
�[33mcommit 9778a81�[m
�[33mcommit 7476ba4�[m
�[33mcommit 121fa8d�[m
�[33mcommit b8702a0�[m
�[33mcommit ed5a4d5�[m
�[33mcommit 384db4f�[m
�[33mcommit b3d2baf�[m
�[33mcommit e3357d9�[m
�[33mcommit 9511ffe�[m
�[33mcommit 985da80�[m
�[33mcommit 03530fa�[m
�[33mcommit 2075509�[m
�[33mcommit e665715�[m
�[33mcommit cea73d6�[m
�[33mcommit e5e14d3�[m
�[33mcommit bc900f5�[m
�[33mcommit e6244e5�[m
�[33mcommit 687cc98�[m
�[33mcommit 83d5a60�[m
�[33mcommit 8895e3b�[m
�[33mcommit 1341e66�[m
�[33mcommit a0911cf�[m
�[33mcommit eb74f21�[m
�[33mcommit 68e766a�[m
�[33mcommit 87bbd2e�[m
�[33mcommit 1001b2b�[m
�[33mcommit f47d56a�[m
�[33mcommit 9b7d710�[m
�[33mcommit 6845dc4�[m
�[33mcommit 038ce65�[m
�[33mcommit 4e17fbd�[m
�[33mcommit 1553ea2�[m
�[33mcommit b4924bf�[m
�[33mcommit 96f50f1�[m
�[33mcommit a646c10�[m
�[33mcommit 3350eaf�[m
�[33mcommit 6fb97a6�[m
�[33mcommit 7b24d2b�[m
�[33mcommit ac64ef3�[m
�[33mcommit 93debaa�[m
�[33mcommit 567f040�[m
�[33mcommit 651b25a�[m
�[33mcommit 351fefb�[m
|
Oh right, its often more useful to filter down to just the bors commits, so that we get a high-level view of the PR's that were merged. Here's a new version of the
�[33mcommit 63d6649�[m
�[33mcommit 5ce5e08�[m
�[33mcommit 54d82d0�[m
�[33mcommit e5284b0�[m
�[33mcommit 35bf1ae�[m
�[33mcommit 827e57c�[m
�[33mcommit c648b0b�[m
�[33mcommit e73077e�[m
�[33mcommit 917945d�[m
�[33mcommit f1b506a�[m
�[33mcommit b75b047�[m
�[33mcommit c24f27c�[m
�[33mcommit 329dde5�[m
�[33mcommit 674ef66�[m
�[33mcommit 71a1ef1�[m
�[33mcommit 24bc544�[m
�[33mcommit 786ccc3�[m
�[33mcommit a79cffb�[m
�[33mcommit 1cbf339�[m
�[33mcommit d0d81b7�[m
�[33mcommit 2d6d3ac�[m
�[33mcommit 9f9f2c0�[m
�[33mcommit a9d4967�[m
�[33mcommit 70c33bb�[m
�[33mcommit 1558ae7�[m
�[33mcommit bf1e461�[m
�[33mcommit 758239c�[m
�[33mcommit d2048b6�[m
�[33mcommit 6bf6d50�[m
�[33mcommit f28f648�[m
�[33mcommit 3ac79c7�[m
�[33mcommit bfc3b20�[m
�[33mcommit b355906�[m
�[33mcommit 8928de7�[m
�[33mcommit a9fe312�[m
|
I guess I'll nominate PR #53316 for potential backporting (with the condition that any hypothetical backport should be accompanied by validation that the backported PR actually is fixing this bug). |
Hmm. It is also worth noting that the issue fixed by PR #53316, namely Issue #52985, explicitly refers to this one, saying that the message is similar but the code is "very different" Nonetheless, from reading over PR #53316, it seems to me like it really did end up explicitly covering cases like this one here on Issue #52701, and it was just an oversight that it wasn't tagged as fixing it...? In any case, I threw a beta- and stable-nomination tag onto PR #53316. |
Is this affecting any crates on crates.io etc? |
As commented in #53316 (comment) this is just a diagnostics issue. The code never compiled successfully. It is supposed to be an error and is so on nightly and beta. |
Okay. As noted above, the bug is fixed in nightly and beta, and in #53316 (comment) it was decided that we would not risk doing a stable backport. So I am closing this as "fixed in beta/nightly and wontfix for current stable." |
Uh oh!
There was an error while loading. Please reload this page.
The following ICE's on nightly and beta, both on debug and release mode:
Stable refuses to compile:
in a way, this is related to #28728 (LLVM optimization bug)
ICE message:
Backtrace:
``` thread 'main' panicked at 'Box', librustc_errors\lib.rs:557:9 stack backtrace: 0: ::drop 1: std::error::> for alloc::boxed::Box<(dyn std::error::Error + core::marker::Send + core::marker::Sync + 'a)>>::from 2: std::panicking::take_hook 3: std::panicking::take_hook 4: ::fmt 5: std::panicking::rust_panic_with_hook 6: ::fmt 7: rustc_errors::Handler::bug 8: as core::clone::Clone>::clone 9: rustc::ty::context::tls::track_diagnostic 10: rustc::ty::context::tls::track_diagnostic 11: rustc::ty::context::tls::track_diagnostic 12: rustc::session::bug_fmt 13: rustc::session::bug_fmt 14: as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty 15: as rustc_traits::lowering::Lower>>>::lower 16: as rustc_traits::lowering::Lower>>>::lower 17: as rustc::ty::context::Lift<'tcx>>::lift_to_tcx 18: rustc_traits::provide 19: as core::fmt::Debug>::fmt 20: rustc::ty::context::tls::track_diagnostic 21: rustc::dep_graph::graph::DepGraph::assert_ignored 22: rustc::ty::context::tls::track_diagnostic 23: rustc::ty::query::plumbing::>::try_print_query_stack 24: rustc::ty::query::plumbing::>::try_print_query_stack 25: as rustc::ty::fold::TypeFolder<'tcx, 'tcx>>::fold_ty 26: as rustc::mir::visit::Visitor<'tcx>>::visit_terminator_kind 27: rustc_mir::monomorphize::collector::collect_crate_mono_items 28: >::visit_local 29: ::fmt 30: rustc_mir::monomorphize::collector::collect_crate_mono_items 31: 32: ::next 33: rustc::ty::context::tls::track_diagnostic 34: rustc::dep_graph::graph::DepGraph::assert_ignored 35: rustc::ty::context::tls::track_diagnostic 36: rustc::ty::query::plumbing::>::try_print_query_stack 37: rustc::ty::query::plumbing::>::try_print_query_stack 38: ::codegen_crate 39: >::visit_item 40: rustc_driver::driver::phase_4_codegen 41: >::visit_impl_item 42: >::visit_impl_item 43: >::visit_item 44: ::fmt 45: rustc_driver::driver::compile_input 46: rustc_driver::run_compiler 47: rustc_driver::target_features::add_configuration 48: >::visit_impl_item 49: _rust_maybe_catch_panic 50: rustc_driver::profile::dump 51: rustc_driver::main 52: 53: std::panicking::update_panic_count 54: _rust_maybe_catch_panic 55: std::rt::lang_start_internal 56: 57: 58: BaseThreadInitThunk 59: RtlUserThreadStart query stack during panic: #0 [normalize_ty_after_erasing_regions] normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: impl std::ops::Fn<()> }` #1 [collect_and_partition_mono_items] collect_and_partition_mono_items end of query stack error: aborting due to previous errornote: 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.29.0-nightly (874dec2 2018-07-21) running on x86_64-pc-windows-msvc
note: compiler flags: -C opt-level=3 --crate-type bin
note: some of the compiler flags provided by cargo are hidden
error: Could not compile
llvm-opt-ice
.To learn more, run the command again with --verbose.
The text was updated successfully, but these errors were encountered: