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, possibly related to associated types of associated types? #36325

Closed
elidupree opened this issue Sep 7, 2016 · 14 comments
Closed

ICE, possibly related to associated types of associated types? #36325

elidupree opened this issue Sep 7, 2016 · 14 comments
Assignees
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@elidupree
Copy link

elidupree commented Sep 7, 2016

(edit from @pnkfelix: if you're looking at this bug, make sure to skip ahead to the comments to see where people have posted links to self-contained reductions to reproduce the bug.)


To reproduce: on the latest nightly, clone https://github.com/elidupree/time-steward (commit ac2db9f6765eeb18692d8588162bc076c9f198c1) and run cargo test, but replace tests/paces.rs:85-88 with:

  paces:: <flat_to_inefficient_full::Steward <Basics, 
    flat_to_inefficient_full::Steward <Basics, memoized_flat::Steward <Basics>>

When I did this, I got:

error: internal compiler error: ../src/librustc/infer/mod.rs:686: Encountered errors `[FulfillmentError(Obligation(predicate=Binder(ProjectionPredicate(ProjectionTy { trait_ref: <&'a steward::stewards::memoized_flat::Snapshot<Basics> as std::iter::IntoIterator>, item_name: Item(116) }, (steward::FieldId, (&'a std::sync::Arc<std::any::Any + 'static>, &'a steward::GenericExtendedTime<steward::DeterministicRandomId>)))),depth=1),MismatchedProjectionTypes(RegionsInsufficientlyPolymorphic(BrNamed(11:DefIndex(3742), 'a(112), WontChange), '_#0r)))]` resolving bounds after type-checking

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: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'Box<Any>', ../src/librustc_errors/lib.rs:590
stack backtrace:
   1:     0x7f7b93670a63 - std::sys::backtrace::tracing::imp::write::h46f28e67d38b4637
   2:     0x7f7b936816ad - std::panicking::default_hook::{{closure}}::h1d3243f546573ff4
   3:     0x7f7b9367fc4e - std::panicking::default_hook::h96c288d728df3ebf
   4:     0x7f7b93680338 - std::panicking::rust_panic_with_hook::hb1322e5f2588b4db
   5:     0x7f7b906f87a8 - std::panicking::begin_panic::hb7c71bbc491f561c
   6:     0x7f7b909a4035 - rustc::session::opt_span_bug_fmt::{{closure}}::h0a2486f2fff54208
   7:     0x7f7b908fb095 - rustc::session::opt_span_bug_fmt::hfa9cff626b4f2b49
   8:     0x7f7b908faf24 - rustc::session::span_bug_fmt::heb3fdb6acac8d0c7
   9:     0x7f7b9084e537 - rustc::infer::InferCtxt::drain_fulfillment_cx_or_panic::h1cc701f94300c6bb
  10:     0x7f7b909466fc - rustc::ty::layout::normalize_associated_type::hcfa61530a7886901
  11:     0x7f7b909469d9 - rustc::ty::layout::Layout::compute_uncached::hdd47920a35587b50
  12:     0x7f7b9096339f - rustc::ty::util::<impl rustc::ty::TyS<'tcx>>::layout::h4668b349f32d3f11
  13:     0x7f7b909476ff - rustc::ty::layout::Layout::compute_uncached::hdd47920a35587b50
  14:     0x7f7b9096339f - rustc::ty::util::<impl rustc::ty::TyS<'tcx>>::layout::h4668b349f32d3f11
  15:     0x7f7b909476ff - rustc::ty::layout::Layout::compute_uncached::hdd47920a35587b50
  16:     0x7f7b9096339f - rustc::ty::util::<impl rustc::ty::TyS<'tcx>>::layout::h4668b349f32d3f11
  17:     0x7f7b909476ff - rustc::ty::layout::Layout::compute_uncached::hdd47920a35587b50
  18:     0x7f7b9096339f - rustc::ty::util::<impl rustc::ty::TyS<'tcx>>::layout::h4668b349f32d3f11
  19:     0x7f7b909476ff - rustc::ty::layout::Layout::compute_uncached::hdd47920a35587b50
  20:     0x7f7b9096339f - rustc::ty::util::<impl rustc::ty::TyS<'tcx>>::layout::h4668b349f32d3f11
  21:     0x7f7b909476ff - rustc::ty::layout::Layout::compute_uncached::hdd47920a35587b50
  22:     0x7f7b9213ecec - rustc::ty::util::<impl rustc::ty::TyS<'tcx>>::layout::h4668b349f32d3f11
  23:     0x7f7b921c163f - rustc_trans::context::CrateContext::layout_of::hbaaecdd9b8a912d1
  24:     0x7f7b9221dd39 - rustc_trans::type_of::sizing_type_of::h1b47e24af719fcdb
  25:     0x7f7b921811de - rustc_trans::abi::FnType::unadjusted::h425ddefde7ae39b2
  26:     0x7f7b921d9969 - rustc_trans::declare::declare_fn::h8c909c61873076f4
  27:     0x7f7b92216688 - rustc_trans::trans_item::TransItem::predefine::h6a4ae615d063f73e
  28:     0x7f7b92195c91 - rustc_trans::base::trans_crate::hf067cf9d0a8bcbf2
  29:     0x7f7b93a3ec9d - rustc_driver::driver::phase_4_translate_to_llvm::he9d5d0022988d46e
  30:     0x7f7b93a7b28c - rustc_driver::driver::compile_input::{{closure}}::h13e3af2358852a64
  31:     0x7f7b93a66525 - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::h2b062b0c671cd504
  32:     0x7f7b93a371b5 - rustc_driver::driver::phase_3_run_analysis_passes::h2f1bd27ff2e4d8a0
  33:     0x7f7b93a27fd3 - rustc_driver::driver::compile_input::h7dacd98cd2fd7d2b
  34:     0x7f7b93a54766 - rustc_driver::run_compiler::h37c4294ab73436f7
  35:     0x7f7b93991ce3 - std::panicking::try::do_call::h4d040997e2efdaf3
  36:     0x7f7b9368f8c6 - __rust_maybe_catch_panic
  37:     0x7f7b939af879 - <F as alloc::boxed::FnBox<A>>::call_box::hefd1c85fab3e6c31
  38:     0x7f7b9367e180 - std::sys::thread::Thread::new::thread_start::h5b631f48cd23f128
  39:     0x7f7b8b763463 - start_thread
  40:     0x7f7b932c930c - clone
  41:                0x0 - <unknown>

error: Could not compile `time_steward`.

Meta

rustc --version --verbose:
rustc 1.13.0-nightly (923bac4 2016-09-06)
binary: rustc
commit-hash: 923bac4
commit-date: 2016-09-06
host: x86_64-unknown-linux-gnu
release: 1.13.0-nightly

@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Sep 7, 2016
@TimNN
Copy link
Contributor

TimNN commented Sep 9, 2016

I have reduced this to a self-contained file with around 50 LOC (and could probably go further but don't have the time right now): https://gist.github.com/cda11d74c476af7339d18a8bf37976e3

This reduced test case is fine on nightly-2016-08-02 and first fails on nightly-2016-08-03 (Changes).

@TimNN
Copy link
Contributor

TimNN commented Sep 9, 2016

Compiling with -Z orbit, nightly-2016-06-21 is fine, and nightly-2016-06-23 fails (nightly-2016-06-22 does not exist) (Changes).

@TimNN
Copy link
Contributor

TimNN commented Sep 9, 2016

This is a regression from stable to beta.

Edit: with the latest test code (see below) this also reproduces on current stable (1.11) but not on 1.10, so a variation of this is also a regression from stable to stable.

@TimNN
Copy link
Contributor

TimNN commented Sep 9, 2016

Actually, with slightly different code, this was introduced between nightly-2016-06-04 and nightly-2016-06-05 (Changes).

cc @nikomatsakis: From the PR's merged in that period, I guess this was an effect of either #33998 or #33816.

@TimNN
Copy link
Contributor

TimNN commented Sep 9, 2016

Cleaned up and slightly more minified version with (hopefully) meaningful names: https://gist.github.com/a8f9885c2bfd585dd8af9b6973cfd219

@TimNN TimNN added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label Sep 15, 2016
@nrc nrc added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 15, 2016
@pnkfelix pnkfelix added the P-high High priority label Sep 15, 2016
@nrc
Copy link
Member

nrc commented Sep 15, 2016

@pnkfelix assigned for initial investigation

@brson
Copy link
Contributor

brson commented Oct 6, 2016

@pnkfelix any updates?

@pnkfelix
Copy link
Member

pnkfelix commented Oct 6, 2016

@brson nothing to report yet; i did some preliminary investigation but need to get back to it.

@jonas-schievink
Copy link
Contributor

#37154 was introduced between the same nightlies

@brson
Copy link
Contributor

brson commented Oct 20, 2016

Nominating for discussion with compiler team. P-high bug, no progress.

@jonas-schievink
Copy link
Contributor

Maybe #37294 already fixes this

@TimNN
Copy link
Contributor

TimNN commented Oct 20, 2016

@jonas-schievink: A stage 1 build of #37294 does indeed seem to fix this issue as well.

@nikomatsakis
Copy link
Contributor

re-assigning to me since #37294 is my PR

@brson
Copy link
Contributor

brson commented Nov 3, 2016

Fixed! Not backporting to 1.13 because the port is non-trivial.

@brson brson closed this as completed Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants