Closed
Description
Minimal reproducer:
// src/lib.rs
pub mod m {
pub struct S;
}
pub trait F {
fn f() -> m::S;
}
impl<T> F for T {
fn f() -> m::S {
m::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:10:601"), crate_id: 0, name: Some("f"), span: Some(Span { filename: "src/lib.rs", begin: (10, 4), end: (12, 5) }), visibility: Default, docs: None, links: {}, attrs: [], deprecation: None, inner: Method(Method { decl: FnDecl { inputs: [], output: Some(ResolvedPath { name: "S", id: Id("0:4:1544"), args: Some(AngleBracketed { args: [], bindings: [] }), param_names: [] }), c_variadic: false }, generics: Generics { params: [], where_predicates: [] }, header: Header { const_: false, unsafe_: false, async_: false, abi: Rust }, has_body: true }) }`,
right: `Item { id: Id("0:10:601"), crate_id: 0, name: Some("f"), span: Some(Span { filename: "src/lib.rs", begin: (10, 4), end: (12, 5) }), visibility: Default, docs: None, links: {}, attrs: [], deprecation: None, inner: Method(Method { decl: FnDecl { inputs: [], output: Some(ResolvedPath { name: "m::S", id: Id("0:4:1544"), args: Some(AngleBracketed { args: [], bindings: [] }), param_names: [] }), c_variadic: false }, generics: Generics { params: [], where_predicates: [] }, header: Header { const_: false, unsafe_: false, async_: false, abi: Rust }, has_body: true }) }`', src/librustdoc/json/mod.rs:202:17
The panic happens because ResolvedPath { name: "S"
!= ResolvedPath { name: "m::S"
, but they are of course equivalent, so we should not panic because of that.
This is (at least partially) a minimal reproducer for #93588.
@rustbot labels +A-rustdoc-json +I-ICE +T-rustdoc