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

cargo doc hit an unexpected panic #50702

Closed
Lokathor opened this issue May 13, 2018 · 0 comments
Closed

cargo doc hit an unexpected panic #50702

Lokathor opened this issue May 13, 2018 · 0 comments
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

@Lokathor
Copy link
Contributor

Lokathor commented May 13, 2018

And then it said that I should report it.

Exact state of the repo: https://github.com/Lokathor/randomize-rs/commit/83d254fffe00a11fb04ae72b6d29723f7ae190c6

terminal session:

D:\dev\randomize-rs>cargo doc
 Documenting randomize v0.890.0-pre (file:///D:/dev/randomize-rs)
thread '<unnamed>' panicked at 'assertion failed: cx.impl_trait_bounds.borrow().is_empty()', librustdoc\clean\mod.rs:4047:5
note: Run with `RUST_BACKTRACE=1` for 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.27.0-nightly (e5f80f2a4 2018-05-09) running on x86_64-pc-windows-msvc

error: Could not document `randomize`.

Caused by:
  process didn't exit successfully: `rustdoc --crate-name randomize src\lib.rs -o D:\dev\randomize-rs\target\doc -L dependency=D:\dev\randomize-rs\target\debug\deps` (exit code: 101)

The offending line seems to be here

  fn distribution<T, D: Borrow<impl Distribution<T>>>(&mut self, d: D) -> T
  where
    Self: Sized,
  {
    d.borrow().sample_with(self)
  }

I guess it's confused about "impl Trait" being mixed with the oldstyle?

changing it to this signature made the documentation generate fine:

  fn distribution<T, D: Distribution<T>, B: Borrow<D>>(&mut self, d: B) -> T
  where
    Self: Sized,
  {
    d.borrow().sample_with(self)
  }
@pietroalbini pietroalbini added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ C-bug Category: This is a bug. labels May 13, 2018
kennytm added a commit to kennytm/rust that referenced this issue May 16, 2018
Fix rustdoc panic with `impl Trait` in type parameters

Fixes rust-lang#50702.

I'm not sure `impl Trait`s neither in arguments nor in return types are supposed to work, though.
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

No branches or pull requests

2 participants