Skip to content

cargo doc hit an unexpected panic #50702

Closed
@Lokathor

Description

@Lokathor

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)
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions