Skip to content

ICE in cargo doc with optin_builtin_traits #55321

Closed
@carado

Description

@carado

Hi, I noticed a weird internal error using cargo doc. The smallest example I could make to reproduce the bug is an basic library project (cargo init --lib) whose lib.rs contains:

#![feature(optin_builtin_traits)]

// the bug doesn't occur if the declaration of B is moved here

pub struct A();

// the bug still happens if the declaration of B is moved here

impl !Send for A {}
impl !Sync for A {}

pub struct B<T: ?Sized>(A, Box<T>);

cargo build, cargo build --release, and cargo check all work fine; and as mentioned in the code, the place where B is declared seems to matter.

Here is the output and trace of cargo doc --verbose: [log was from an out of date nightly rust, see my comment below for the log for the latest nightly as of this edit]

Have a nice day.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-synthetic-implsArea: Synthetic impls, used by rustdoc to document auto traits and traits with blanket implsI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions