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

Rustdoc ICE 'Infer', src/librustdoc/clean/mod.rs #60269

Closed
LucioFranco opened this issue Apr 25, 2019 · 3 comments · Fixed by #60344
Closed

Rustdoc ICE 'Infer', src/librustdoc/clean/mod.rs #60269

LucioFranco opened this issue Apr 25, 2019 · 3 comments · Fixed by #60344
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@LucioFranco
Copy link
Member

Hello! I searched around and couldn't find any issue that is related to this. I have compiling code here https://github.com/tower-rs/tower-hyper that seems to fail when in run cargo doc with:

thread 'rustc' panicked at 'Infer', src/librustdoc/clean/mod.rs:2903:30
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.34.0 (91856ed52 2019-04-10) running on x86_64-apple-darwin

error: Could not document `tower-hyper`.

Caused by:
  process didn't exit successfully: `rustdoc --edition=2018 --crate-name tower_hyper src/lib.rs --color always -o /Users/lucio/code/tower-hyper/target/doc -L dependency=/Users/lucio/code/tower-hyper/target/debug/deps --extern futures=/Users/lucio/code/tower-hyper/target/debug/deps/libfutures-1e2999450b2419eb.rmeta --extern http=/Users/lucio/code/tower-hyper/target/debug/deps/libhttp-cf0a3164f3f563fd.rmeta --extern hyper=/Users/lucio/code/tower-hyper/target/debug/deps/libhyper-452ca54e3f820463.rmeta --extern log=/Users/lucio/code/tower-hyper/target/debug/deps/liblog-75a074a4b89524ff.rmeta --extern tokio_buf=/Users/lucio/code/tower-hyper/target/debug/deps/libtokio_buf-cd9601f408caeb33.rmeta --extern tokio_executor=/Users/lucio/code/tower-hyper/target/debug/deps/libtokio_executor-c67f7b74fd64079c.rmeta --extern tokio_io=/Users/lucio/code/tower-hyper/target/debug/deps/libtokio_io-1de1b000031540d9.rmeta --extern tower=/Users/lucio/code/tower-hyper/target/debug/deps/libtower-dfc827168ff91516.rmeta --extern tower_http=/Users/lucio/code/tower-hyper/target/debug/deps/libtower_http-b4824a8d9ae1e7e3.rmeta --extern tower_service=/Users/lucio/code/tower-hyper/target/debug/deps/libtower_service-167cf579d007ab89.rmeta` (exit code: 1)
tower-hyper(master): cargo --version
cargo 1.34.0 (6789d8a0a 2019-04-01)
tower-hyper(master): rustc --version -v
rustc 1.34.0 (91856ed52 2019-04-10)
binary: rustc
commit-hash: 91856ed52c58aa5ba66a015354d1cc69e9779bdf
commit-date: 2019-04-10
host: x86_64-apple-darwin
release: 1.34.0
LLVM version: 8.0

Specifically speaking, I am able to document the crate without an ICE happening if I disable this module https://github.com/tower-rs/tower-hyper/blob/master/src/server/mod.rs.

More specifically, I have a feeling that this is happening due to bounds on this impl https://github.com/tower-rs/tower-hyper/blob/master/src/server/mod.rs#L97. This mod was compiling and documenting fine before I add this impl for Serve.

Let me know if there is anything else I can provide to help.

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. I-nominated labels Apr 25, 2019
@hellow554
Copy link
Contributor

hellow554 commented Apr 25, 2019

Can you please RUST_BACKTRACE=full cargo doc and post the result here?

@LucioFranco
Copy link
Member Author

@hellow554 yup! here it is

 Documenting tower-hyper v0.1.0 (/Users/lucio/code/tower-hyper)
thread 'rustc' panicked at 'Infer', src/librustdoc/clean/mod.rs:2903:30
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::_print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::begin_panic
   6: <&'tcx rustc::ty::TyS<'tcx> as rustdoc::clean::Clean<rustdoc::clean::Type>>::clean
   7: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
   8: rustdoc::clean::external_path
   9: <&'tcx rustc::ty::TyS<'tcx> as rustdoc::clean::Clean<rustdoc::clean::Type>>::clean
  10: <rustc::ty::Predicate<'a> as rustdoc::clean::Clean<core::option::Option<rustdoc::clean::WherePredicate>>>::clean
  11: rustdoc::clean::auto_trait::AutoTraitFinder::param_env_to_generics
  12: rustc::ty::context::tls::with_context::{{closure}}
  13: rustc::ty::context::GlobalCtxt::enter_local
  14: rustc::traits::auto_trait::AutoTraitFinder::find_auto_trait_generics
  15: rustdoc::clean::auto_trait::AutoTraitFinder::get_auto_trait_impl_for
  16: rustdoc::clean::auto_trait::AutoTraitFinder::get_auto_trait_impls
  17: rustdoc::clean::def_ctor::get_def_from_node_id
  18: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector<'a, 'tcx, 'rcx> as rustdoc::fold::DocFolder>::fold_item
  19: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
  20: rustdoc::fold::DocFolder::fold_inner_recur
  21: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector<'a, 'tcx, 'rcx> as rustdoc::fold::DocFolder>::fold_item
  22: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
  23: rustdoc::fold::DocFolder::fold_inner_recur
  24: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector<'a, 'tcx, 'rcx> as rustdoc::fold::DocFolder>::fold_item
  25: rustdoc::passes::collect_trait_impls::collect_trait_impls
  26: rustdoc::core::run_core::{{closure}}::{{closure}}
  27: <std::thread::local::LocalKey<T>>::with
  28: rustc::ty::context::TyCtxt::create_and_enter
  29: rustc_driver::driver::phase_3_run_analysis_passes
  30: <scoped_tls::ScopedKey<T>>::set
  31: <scoped_tls::ScopedKey<T>>::set
  32: syntax::with_globals

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.34.0 (91856ed52 2019-04-10) running on x86_64-apple-darwin

error: Could not document `tower-hyper`.

Caused by:
  process didn't exit successfully: `rustdoc --edition=2018 --crate-name tower_hyper src/lib.rs --color always -o /Users/lucio/code/tower-hyper/target/doc -L dependency=/Users/lucio/code/tower-hyper/target/debug/deps --extern futures=/Users/lucio/code/tower-hyper/target/debug/deps/libfutures-1e2999450b2419eb.rmeta --extern http=/Users/lucio/code/tower-hyper/target/debug/deps/libhttp-cf0a3164f3f563fd.rmeta --extern hyper=/Users/lucio/code/tower-hyper/target/debug/deps/libhyper-452ca54e3f820463.rmeta --extern log=/Users/lucio/code/tower-hyper/target/debug/deps/liblog-75a074a4b89524ff.rmeta --extern tokio_buf=/Users/lucio/code/tower-hyper/target/debug/deps/libtokio_buf-cd9601f408caeb33.rmeta --extern tokio_executor=/Users/lucio/code/tower-hyper/target/debug/deps/libtokio_executor-c67f7b74fd64079c.rmeta --extern tokio_io=/Users/lucio/code/tower-hyper/target/debug/deps/libtokio_io-1de1b000031540d9.rmeta --extern tower=/Users/lucio/code/tower-hyper/target/debug/deps/libtower-dfc827168ff91516.rmeta --extern tower_http=/Users/lucio/code/tower-hyper/target/debug/deps/libtower_http-b4824a8d9ae1e7e3.rmeta --extern tower_service=/Users/lucio/code/tower-hyper/target/debug/deps/libtower_service-167cf579d007ab89.rmeta` (exit code: 1)

@Aaron1011
Copy link
Member

I'd like to work on this.

Aaron1011 added a commit to Aaron1011/rust that referenced this issue Apr 28, 2019
Previously, we checked if the target of a projection type was itself an
inference variable. However, for Rustdoc rendering purposes, there's no
distinction between an inference variable ('_') and a type containing
one (e.g. (MyStruct<u8, _>)) - we don't want to render either of them.

Fixes rust-lang#60269

Due to the complexity of the original bug, which spans three different
crates (hyper, tower-hyper, and tower), I have been unable to create a
minimized reproduction for the issue.
Centril added a commit to Centril/rust that referenced this issue Apr 30, 2019
Don't try to render auto-trait bounds with any inference variables

Previously, we checked if the target of a projection type was itself an
inference variable. However, for Rustdoc rendering purposes, there's no
distinction between an inference variable ('_') and a type containing
one (e.g. (MyStruct<u8, _>)) - we don't want to render either of them.

Fixes rust-lang#60269

Due to the complexity of the original bug, which spans three different
crates (hyper, tower-hyper, and tower), I have been unable to create a
minimized reproduction for the issue.
Centril added a commit to Centril/rust that referenced this issue Apr 30, 2019
Don't try to render auto-trait bounds with any inference variables

Previously, we checked if the target of a projection type was itself an
inference variable. However, for Rustdoc rendering purposes, there's no
distinction between an inference variable ('_') and a type containing
one (e.g. (MyStruct<u8, _>)) - we don't want to render either of them.

Fixes rust-lang#60269

Due to the complexity of the original bug, which spans three different
crates (hyper, tower-hyper, and tower), I have been unable to create a
minimized reproduction for the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants