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 when running `cargo doc` on `typenum` at `librustc/traits/structural_impls.rs:178` #52873

Closed
hdevalence opened this issue Jul 30, 2018 · 14 comments · Fixed by #54199
Closed

ICE when running `cargo doc` on `typenum` at `librustc/traits/structural_impls.rs:178` #52873

hdevalence opened this issue Jul 30, 2018 · 14 comments · Fixed by #54199

Comments

@hdevalence
Copy link

@hdevalence hdevalence commented Jul 30, 2018

 Documenting typenum v1.10.0 (file:///home/hdevalence/code/typenum)
error: internal compiler error: librustc/traits/structural_impls.rs:178: impossible case reached

thread '<unnamed>' panicked at 'Box<Any>', librustc_errors/lib.rs:578:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.

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.29.0-nightly (866a71325 2018-07-29) running on x86_64-unknown-linux-gnu

error: Could not document `typenum`.

Steps to reproduce:

git clone https://github.com/paholg/typenum.git
cd typenum
echo 'nightly-2018-07-24' > rust-toolchain
cargo doc # works
echo 'nightly-2018-07-30' > rust-toolchain
cargo doc # ICE
@GuillaumeGomez

This comment has been minimized.

Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Jul 31, 2018

I assume this is the same as #52611.

@VictorKoenders

This comment has been minimized.

Copy link

@VictorKoenders VictorKoenders commented Aug 12, 2018

Running into this as well when running cargo doc on 1.30.0-nightly (73c7873 2018-08-05)

http://github.com/victorkoenders/orm

error: internal compiler error: librustc\traits\structural_impls.rs:178: impossible case reached

thread '<unnamed>' panicked at 'Box<Any>', librustc_errors\lib.rs:578:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.

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.30.0-nightly (73c78734b 2018-08-05) running on x86_64-pc-windows-msvc

error: Could not document `typenum`.
@MSleepyPanda

This comment has been minimized.

Copy link

@MSleepyPanda MSleepyPanda commented Aug 21, 2018

Hit this on the newest nightly (33b923f 2018-08-18)

@VictorKoenders

This comment has been minimized.

Copy link

@VictorKoenders VictorKoenders commented Aug 21, 2018

Same issue, slightly different line number

rustc 1.30.0-nightly (33b923fd4 2018-08-18)
binary: rustc
commit-hash: 33b923fd44c5c5925e635815fce68bdf1f98740f
commit-date: 2018-08-18
host: x86_64-pc-windows-msvc
release: 1.30.0-nightly
LLVM version: 7.0

Filtered log:

 Documenting typenum v1.10.0
     Running `rustdoc --crate-name typenum C:\Users\Victor\.cargo\registry\src\github.com-1ecc6299db9ec823\typenum-1.10.0\src\lib.rs --cap-lints warn -o D:\Development\rust\orm\target\doc -L dependency=D:\Development\rust\orm\target\debug\deps`

error: internal compiler error: librustc\traits\structural_impls.rs:178: impossible case reached

thread '<unnamed>' panicked at 'Box<Any>', librustc_errors\lib.rs:579:9

stack backtrace:
   0:      0x7fec2d40b63 - <std::sys::windows::args::Args as core::ops::drop::Drop>::drop::h07841acef7f9fb3b
   1:      0x7fec2d2a07f - <std::sys::windows::dynamic_lib::DynamicLibrary as core::ops::drop::Drop>::drop::h226bbb1fa45d584f
   2:      0x7fec2d28478 - std::panicking::take_hook::h99aaaf280ee62516
   3:      0x7fec2d28131 - std::panicking::take_hook::h99aaaf280ee62516
   4:      0x7fec2d28c7c - std::panicking::rust_panic_with_hook::ha70ac236a1ec44dd
   5:      0x7fee74590e2 - <rustc_errors::diagnostic::SubDiagnostic as core::fmt::Debug>::fmt::hf147e4b7188a1285
   6:      0x7fee7454619 - rustc_errors::Handler::bug::h5ba7d2a37e6d06a3
   7:      0x7fec34169cb - rustc::util::bug::bug_fmt::hd0f455d506468210
   8:      0x7fec3415f4c - rustc::ty::context::tls::track_diagnostic::h5e461387e66ce2d9
   9:      0x7fec3393d15 - rustc::ty::context::tls::track_diagnostic::h5e461387e66ce2d9
  10:      0x7fec34156f9 - rustc::ty::context::tls::track_diagnostic::h5e461387e66ce2d9
  11:      0x7fec34168dc - rustc::util::bug::bug_fmt::hd0f455d506468210
  12:      0x7fec3416842 - rustc::util::bug::bug_fmt::hd0f455d506468210
  13:      0x7fec315299d - rustc::traits::structural_impls::<impl rustc::ty::context::Lift<'tcx> for rustc::traits::SelectionError<'a>>::lift_to_tcx::h82aa210d085894b4
  14:      0x7fec35d2dec - rustc::ty::context::TyCtxt::intern_layout::ha57401a3edfd8794
  15:      0x7fec314469b - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  16:      0x7fec3143707 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  17:      0x7fec31ff26b - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  18:      0x7fec3142295 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  19:      0x7fec374480d - rustc::infer::InferCtxt::commit_from::h29f023f92d762265
  20:      0x7fec361c3d7 - rustc::ty::context::TypeckTables::expr_ty::h07311fd154b7e722
  21:      0x7fec30c3ad0 - <unknown>
  22:      0x7fec3145260 - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  23:      0x7fec31ffa60 - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  24:      0x7fec31444dd - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  25:      0x7fec3143707 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  26:      0x7fec31ff26b - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  27:      0x7fec3142295 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  28:      0x7fec374480d - rustc::infer::InferCtxt::commit_from::h29f023f92d762265
  29:      0x7fec361c3d7 - rustc::ty::context::TypeckTables::expr_ty::h07311fd154b7e722
  30:      0x7fec30c3ad0 - <unknown>
  31:      0x7fec3145260 - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  32:      0x7fec31ffa60 - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  33:      0x7fec31444dd - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  34:      0x7fec3143707 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  35:      0x7fec31ff26b - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  36:      0x7fec3142295 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  37:      0x7fec374480d - rustc::infer::InferCtxt::commit_from::h29f023f92d762265
  38:      0x7fec361c3d7 - rustc::ty::context::TypeckTables::expr_ty::h07311fd154b7e722
  39:      0x7fec30c3ad0 - <unknown>
  40:      0x7fec3145260 - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  41:      0x7fec31ffa60 - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  42:      0x7fec31444dd - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  43:      0x7fec3143707 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  44:      0x7fec31ff26b - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  45:      0x7fec3142295 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  46:      0x7fec374480d - rustc::infer::InferCtxt::commit_from::h29f023f92d762265
  47:      0x7fec361c3d7 - rustc::ty::context::TypeckTables::expr_ty::h07311fd154b7e722
  48:      0x7fec30c3ad0 - <unknown>
  49:      0x7fec3145260 - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  50:      0x7fec31ffa60 - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  51:      0x7fec31444dd - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  52:      0x7fec3143707 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  53:      0x7fec31ff26b - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  54:      0x7fec3142295 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  55:      0x7fec374480d - rustc::infer::InferCtxt::commit_from::h29f023f92d762265
  56:      0x7fec361c3d7 - rustc::ty::context::TypeckTables::expr_ty::h07311fd154b7e722
  57:      0x7fec30c3ad0 - <unknown>
  58:      0x7fec3145260 - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  59:      0x7fec31ffa60 - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  60:      0x7fec31444dd - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  61:      0x7fec3143707 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  62:      0x7fec31ff26b - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  63:      0x7fec3142295 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  64:      0x7fec374480d - rustc::infer::InferCtxt::commit_from::h29f023f92d762265
  65:      0x7fec361c3d7 - rustc::ty::context::TypeckTables::expr_ty::h07311fd154b7e722
  66:      0x7fec30c3ad0 - <unknown>
  67:      0x7fec3145260 - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  68:      0x7fec31ffa60 - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  69:      0x7fec31444dd - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  70:      0x7fec3143707 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  71:      0x7fec31ff26b - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  72:      0x7fec3142295 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  73:      0x7fec374480d - rustc::infer::InferCtxt::commit_from::h29f023f92d762265
  74:      0x7fec361c3d7 - rustc::ty::context::TypeckTables::expr_ty::h07311fd154b7e722
  75:      0x7fec30c3ad0 - <unknown>
  76:      0x7fec3145260 - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  77:      0x7fec31ffa60 - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  78:      0x7fec31444dd - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  79:      0x7fec3143707 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  80:      0x7fec31ff26b - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  81:      0x7fec3142295 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  82:      0x7fec374480d - rustc::infer::InferCtxt::commit_from::h29f023f92d762265
  83:      0x7fec361c3d7 - rustc::ty::context::TypeckTables::expr_ty::h07311fd154b7e722
  84:      0x7fec30c3ad0 - <unknown>
  85:      0x7fec3145260 - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  86:      0x7fec31ffa60 - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  87:      0x7fec31444dd - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  88:      0x7fec3143707 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  89:      0x7fec31ff26b - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  90:      0x7fec3142295 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  91:      0x7fec374480d - rustc::infer::InferCtxt::commit_from::h29f023f92d762265
  92:      0x7fec361c3d7 - rustc::ty::context::TypeckTables::expr_ty::h07311fd154b7e722
  93:      0x7fec30c3ad0 - <unknown>
  94:      0x7fec3145260 - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  95:      0x7fec31ffa60 - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  96:      0x7fec31444dd - rustc::traits::select::SelectionContext::coinductive_predicate::he82cb534328ed0b2
  97:      0x7fec3143707 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d
  98:      0x7fec31ff26b - rustc::dep_graph::graph::DepGraph::assert_ignored::hbdde8c850282765c
  99:      0x7fec3142295 - rustc::traits::select::SelectionContext::evaluate_obligation_recursively::habed88d9c383763d

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.30.0-nightly (33b923fd4 2018-08-18) running on x86_64-pc-windows-msvc

error: Could not document `typenum`.
@nikomatsakis

This comment has been minimized.

Copy link
Contributor

@nikomatsakis nikomatsakis commented Aug 23, 2018

@GuillaumeGomez any idea what's going on here? let us know if you need T-compiler help :)

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Aug 23, 2018

@nikomatsakis I didn't check yet, still on my todo list. I'll give it a look this week-end.

@pietroalbini pietroalbini moved this from Triaged to Fix in progress in 1.29 regressions Aug 25, 2018
@nikomatsakis

This comment has been minimized.

Copy link
Contributor

@nikomatsakis nikomatsakis commented Aug 29, 2018

It would be great to have a minimized example here =)

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Aug 30, 2018

True, I'll try to make one.

@pietroalbini pietroalbini moved this from Fix in progress to Backport in progress in 1.29 regressions Sep 10, 2018
bors added a commit that referenced this issue Sep 10, 2018
…Simulacrum

[beta] rustdoc: disable blanket impl collection

Beta patch for #52873 so we don't propagate the ICE into stable. (This time on the correct branch!)

r? @rust-lang/rustdoc @Mark-Simulacrum
@pietroalbini pietroalbini moved this from Backport in progress to Fixed in 1.29 regressions Sep 11, 2018
@joelgallant

This comment has been minimized.

Copy link
Contributor

@joelgallant joelgallant commented Sep 12, 2018

I think this is the same as #54002 as well

@pnkfelix

This comment has been minimized.

Copy link
Member

@pnkfelix pnkfelix commented Sep 20, 2018

visited for triage. PR #54199 just needs to be landed.

bors added a commit that referenced this issue Sep 26, 2018
overlook overflows in rustdoc trait solving

Context:

The new rustdoc "auto trait" feature walks across impls and tries to run trait solving on them with a lot of unconstrained variables. This is prone to overflows. These overflows used to cause an ICE because of a caching bug (fixed in this PR). But even once that is fixed, it means that rustdoc causes an overflow rather than generating docs.

This PR therefore adds a new helper that propagates the overflow error out. This requires rustdoc to then decide what to do when it encounters such an overflow: technically, an overflow represents neither "yes" nor "no", but rather a failure to make a decision. I've decided to opt on the side of treating this as "yes, implemented", since rustdoc already takes an optimistic view. This may prove to include too many items, but I *suspect* not.

We could probably reduce the rate of overflows by unifying more of the parameters from the impl -- right now we only seem to consider the self type. Moreover, in the future, as we transition to Chalk, overflow errors are expected to just "go away" (in some cases, though, queries might return an ambiguous result).

Fixes #52873

cc @QuietMisdreavus -- this is the stuff we were talking about earlier
cc @GuillaumeGomez -- this supersedes #53687
bors added a commit that referenced this issue Sep 26, 2018
overlook overflows in rustdoc trait solving

Context:

The new rustdoc "auto trait" feature walks across impls and tries to run trait solving on them with a lot of unconstrained variables. This is prone to overflows. These overflows used to cause an ICE because of a caching bug (fixed in this PR). But even once that is fixed, it means that rustdoc causes an overflow rather than generating docs.

This PR therefore adds a new helper that propagates the overflow error out. This requires rustdoc to then decide what to do when it encounters such an overflow: technically, an overflow represents neither "yes" nor "no", but rather a failure to make a decision. I've decided to opt on the side of treating this as "yes, implemented", since rustdoc already takes an optimistic view. This may prove to include too many items, but I *suspect* not.

We could probably reduce the rate of overflows by unifying more of the parameters from the impl -- right now we only seem to consider the self type. Moreover, in the future, as we transition to Chalk, overflow errors are expected to just "go away" (in some cases, though, queries might return an ambiguous result).

Fixes #52873

cc @QuietMisdreavus -- this is the stuff we were talking about earlier
cc @GuillaumeGomez -- this supersedes #53687
@bors bors closed this in #54199 Sep 26, 2018
@QuietMisdreavus

This comment has been minimized.

Copy link
Member

@QuietMisdreavus QuietMisdreavus commented Oct 25, 2018

Reopening; since we never backported #54199, rustdoc ICE's on typenum again.

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Nov 7, 2018
…re, r=eddyb

overlook overflows in rustdoc trait solving

Context:

The new rustdoc "auto trait" feature walks across impls and tries to run trait solving on them with a lot of unconstrained variables. This is prone to overflows. These overflows used to cause an ICE because of a caching bug (fixed in this PR). But even once that is fixed, it means that rustdoc causes an overflow rather than generating docs.

This PR therefore adds a new helper that propagates the overflow error out. This requires rustdoc to then decide what to do when it encounters such an overflow: technically, an overflow represents neither "yes" nor "no", but rather a failure to make a decision. I've decided to opt on the side of treating this as "yes, implemented", since rustdoc already takes an optimistic view. This may prove to include too many items, but I *suspect* not.

We could probably reduce the rate of overflows by unifying more of the parameters from the impl -- right now we only seem to consider the self type. Moreover, in the future, as we transition to Chalk, overflow errors are expected to just "go away" (in some cases, though, queries might return an ambiguous result).

Fixes rust-lang#52873

cc @QuietMisdreavus -- this is the stuff we were talking about earlier
cc @GuillaumeGomez -- this supersedes rust-lang#53687
@pnkfelix

This comment has been minimized.

Copy link
Member

@pnkfelix pnkfelix commented Nov 8, 2018

visiting for triage. It looks like PR #54199 is on target to be backported to stable. (In fact, the recent update of the labels to say just stable-accepted leads me to assume that the backport has occurred... yes, it was part of PR #55738)

@pnkfelix

This comment has been minimized.

Copy link
Member

@pnkfelix pnkfelix commented Nov 8, 2018

So, only two questions I have now:

  1. I openly mused to myself during this triage session that the failure to backport to beta sooner may represent a process failure of some sort. But there may be a very simple fix: Can/should we revise bors to not autoclose issues that are tagged as stable-to-beta or stable-to-stable regressions?
  2. On the subject of closing: Can we close this issue in light of #55738? Or do we need to wait until the 1.30.1 point release has officially been deployed?
@nagisa nagisa closed this Nov 15, 2018
@nagisa

This comment has been minimized.

Copy link
Contributor

@nagisa nagisa commented Nov 15, 2018

Closed since 1.30.1 was released already.

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