Skip to content

Internal compiler error in rustc_resolve when generating documentation #95728

Closed
@honzasp

Description

@honzasp

When docs.rs builds documentation for version 0.4.0 of the turbojpeg crate, rustc (rustc 1.62.0-nightly (306ba83 2022-04-05)) crashes:

thread 'rustc' panicked at 'internal error: entered unreachable code', compiler/rustc_resolve/src/lib.rs:3302:67

I managed to reduce the issue to a single line of code:

//! [::image::ImageBuffer]

Reproducing

To reproduce the full issue, you can clone the turbojpeg repo and run:

rustup run nightly -- cargo doc --open

(you can pass --features image to cargo doc to get rid of the "unresolved link" warnings; the crash happens in both cases)

Meta

I can reproduce the same issue locally with the nightly compiler (rustc 1.62.0-nightly (306ba83 2022-04-05)), but not with the stable compiler (rustc 1.59.0 (9d1b210 2022-02-23)).

Error output

For the full backtrace, please see the build report on docs.rs.

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-compilerRelevant to the compiler 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