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-json: ICE with associated type in trait #98547

Closed
Enselic opened this issue Jun 26, 2022 · 1 comment · Fixed by #98548
Closed

rustdoc-json: ICE with associated type in trait #98547

Enselic opened this issue Jun 26, 2022 · 1 comment · Fixed by #98548
Labels
A-rustdoc-json Area: Rustdoc JSON backend 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

@Enselic
Copy link
Member

Enselic commented Jun 26, 2022

Minimal reproducer with 1.64.0-nightly (20a6f3a8a 2022-06-25):

// src/lib.rs

pub trait Trait {
    type AssocType;
}

impl<T> Trait for T {
    type AssocType = Self;
}

pub struct S;
% RUSTDOCFLAGS='-Z unstable-options --output-format json' cargo +nightly doc --lib --no-deps  
thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `Item { id: Id("0:7:1558"), crate_id: 0, name: Some("AssocType"), span: Some(Span { filename: "src/lib.rs", begin: (8, 4), end: (8, 26) }), visibility: Default, docs: None, links: {}, attrs: [], deprecation: None, inner: Typedef(Typedef { type_: Generic("Self"), generics: Generics { params: [], where_predicates: [] } }) }`,
 right: `Item { id: Id("0:7:1558"), crate_id: 0, name: Some("AssocType"), span: Some(Span { filename: "src/lib.rs", begin: (8, 4), end: (8, 26) }), visibility: Default, docs: None, links: {}, attrs: [], deprecation: None, inner: Typedef(Typedef { type_: Generic("T"), generics: Generics { params: [], where_predicates: [] } }) }`', src/librustdoc/json/mod.rs:234:21

PR with a fix proposal: #98548

@rustbot labels +A-rustdoc-json +I-ICE +T-rustdoc

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend 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. labels Jun 26, 2022
@Enselic
Copy link
Member Author

Enselic commented Jun 28, 2022

Closed by #98577

@Enselic Enselic closed this as completed Jun 28, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 28, 2022
…doc-json, r=GuillaumeGomez

rustdoc-json: Allow Typedef to be different in sanity assert

Closes rust-lang#98547

This fix is a natural extension of rust-lang#98053.

r? `@notriddle`

(Since you reviewed the other PR.)

CC `@GuillaumeGomez`

`@rustbot` labels +A-rustdoc-json +T-rustdoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend 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.

2 participants