Skip to content

rustdoc --output-format json assert while documenting the syn crate #87951

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

Closed
Urgau opened this issue Aug 12, 2021 · 2 comments
Closed

rustdoc --output-format json assert while documenting the syn crate #87951

Urgau opened this issue Aug 12, 2021 · 2 comments
Labels
A-rustdoc-json Area: Rustdoc JSON backend C-bug Category: This is a bug. 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

@Urgau
Copy link
Member

Urgau commented Aug 12, 2021

Code

From the syn source code:

pub trait Spanned {
    /// Returns a `Span` covering the complete contents of this syntax tree
    /// node, or [`Span::call_site()`] if this node is empty.
    ///
    /// [`Span::call_site()`]: proc_macro2::Span::call_site
    fn span(&self) -> Span;
}

impl<T: ?Sized + ToTokens> Spanned for T {
    fn span(&self) -> Span {
        self.__span()
    }
}

Meta

rustc +nightly --version

rustc 1.56.0-nightly (ccffcafd5 2021-08-11)

rustdoc +nightly --version

rustdoc 1.56.0-nightly (ccffcafd5 2021-08-11)

Error output

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `Item { id: Id("0:3511"), crate_id: 0, name: Some("span"), span: Some(Span { filename: "REDACTED/.cargo/registry/src/github.com-1285ae84e5963aae/syn-1.0.74/src/spanned.rs", begin: (111, 4), end: (113, 5) }), visibility: Public, docs: None, links: {}, attrs: [], deprecation: None, inner: Method(Method { decl: FnDecl { inputs: [("", BorrowedRef { lifetime: None, mutable: false, type_: Generic("Self") })], output: Some(ResolvedPath { name: "Span", id: Id("20:909"), args: Some(AngleBracketed { args: [], bindings: [] }), param_names: [] }), c_variadic: false }, generics: Generics { params: [], where_predicates: [] }, header: {}, abi: "\"Rust\"", has_body: true }) }`,
 right: `Item { id: Id("0:3511"), crate_id: 0, name: Some("span"), span: Some(Span { filename: "REDACTED/.cargo/registry/src/github.com-1285ae84e5963aae/syn-1.0.74/src/spanned.rs", begin: (111, 4), end: (113, 5) }), visibility: Default, docs: None, links: {}, attrs: [], deprecation: None, inner: Method(Method { decl: FnDecl { inputs: [("self", BorrowedRef { lifetime: None, mutable: false, type_: Generic("Self") })], output: Some(ResolvedPath { name: "Span", id: Id("20:909"), args: Some(AngleBracketed { args: [], bindings: [] }), param_names: [] }), c_variadic: false }, generics: Generics { params: [], where_predicates: [] }, header: {}, abi: "\"Rust\"", has_body: true }) }`', src/librustdoc/json/mod.rs:179:17
Backtrace

stack backtrace:
   0: rust_begin_unwind
             at /rustc/ccffcafd55e58f769d4b0efc0064bf65e76998e4/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/ccffcafd55e58f769d4b0efc0064bf65e76998e4/library/core/src/panicking.rs:93:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
   4: <rustdoc::json::JsonRenderer as rustdoc::formats::renderer::FormatRenderer>::item
   5: <rustdoc::json::JsonRenderer as rustdoc::formats::renderer::FormatRenderer>::item
   6: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
   7: <rustdoc::json::JsonRenderer as rustdoc::formats::renderer::FormatRenderer>::item
   8: <rustdoc::json::JsonRenderer as rustdoc::formats::renderer::FormatRenderer>::item
   9: <rustdoc::json::JsonRenderer as rustdoc::formats::renderer::FormatRenderer>::item
  10: rustdoc::formats::renderer::run_format
  11: rustdoc::run_renderer
  12: rustc_interface::interface::create_compiler_and_run
  13: rustdoc::main_options
  14: scoped_tls::ScopedKey<T>::set

@Urgau Urgau added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 12, 2021
@Urgau
Copy link
Member Author

Urgau commented Aug 13, 2021

cc @jyn514 @P1n3appl3 @GuillaumeGomez

@rustbot label +T-rustdoc +A-rustdoc-json -T-compiler

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 13, 2021
@jyn514
Copy link
Member

jyn514 commented Aug 15, 2021

This is likely a duplicate of #83718.

@jyn514 jyn514 closed this as completed Aug 15, 2021
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 C-bug Category: This is a bug. 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

No branches or pull requests

3 participants