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: is not supported in json output #98002

Closed
matthiaskrgr opened this issue Jun 11, 2022 · 1 comment · Fixed by #98390
Closed

rustdoc json ice: is not supported in json output #98002

matthiaskrgr opened this issue Jun 11, 2022 · 1 comment · Fixed by #98390
Labels
A-rustdoc-json Area: Rustdoc JSON backend C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. 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

@matthiaskrgr
Copy link
Member

Code

./src/test/rustdoc/keyword.rs

#![crate_name = "foo"]

#![feature(rustdoc_internals)]

// @has foo/index.html '//h2[@id="keywords"]' 'Keywords'
// @has foo/index.html '//a[@href="keyword.match.html"]' 'match'
// @has foo/index.html '//div[@class="sidebar-elems"]//li/a' 'Keywords'
// @has foo/index.html '//div[@class="sidebar-elems"]//li/a/@href' '#keywords'
// @has foo/keyword.match.html '//a[@class="keyword"]' 'match'
// @has foo/keyword.match.html '//span[@class="in-band"]' 'Keyword match'
// @has foo/keyword.match.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
// @has foo/index.html '//a/@href' '../foo/index.html'
// @!has foo/foo/index.html
// @!has-dir foo/foo
// @!has foo/index.html '//span' '🔒'
#[doc(keyword = "match")]
/// this is a test!
mod foo{}

// @has foo/keyword.foo.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'hello'
#[doc(keyword = "foo")]
/// hello
mod bar {}

Meta

rustc --version --verbose:

rustdoc 1.63.0-nightly (c08b235a5 2022-06-11)
binary: rustdoc
commit-hash: c08b235a5ce10167632bb0fddcd0c5d67f2d42e3
commit-date: 2022-06-11
host: x86_64-unknown-linux-gnu
release: 1.63.0-nightly
LLVM version: 14.0.5

Error output

rustdoc -Zunstable-options --output-format json <file>

<output>
Backtrace

thread 'rustc' panicked at 'Item { name: Some("match"), visibility: Public, item_id: DefId(DefId(0:3 ~ foo[8c0b]::foo)), kind: Keyword, docs: Some("this is a test!") } is not supported for JSON output', src/librustdoc/json/conversions.rs:260:13
stack backtrace:
   0:     0x7f31e769e24d - std::backtrace_rs::backtrace::libunwind::trace::hbda756d3a5f7793b
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f31e769e24d - std::backtrace_rs::backtrace::trace_unsynchronized::he406e69cad63dc23
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f31e769e24d - std::sys_common::backtrace::_print_fmt::haf02d0db8ce964ea
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f31e769e24d - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h593e23fa276ab7eb
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f31e76fa03c - core::fmt::write::h15ae908cdc2b7057
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/core/src/fmt/mod.rs:1196:17
   5:     0x7f31e768f9e1 - std::io::Write::write_fmt::hd05fda0f86262a57
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/io/mod.rs:1654:15
   6:     0x7f31e76a0f25 - std::sys_common::backtrace::_print::h56e00569a093de7b
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f31e76a0f25 - std::sys_common::backtrace::print::h154890ec5be15427
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f31e76a0f25 - std::panicking::default_hook::{{closure}}::h956bfa0e86fe51f6
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:295:22
   9:     0x7f31e76a0c46 - std::panicking::default_hook::h6043872de872daf7
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:314:9
  10:     0x7f31e7efac61 - rustc_driver[887956d0deaa6d7a]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f31e76a15fa - std::panicking::rust_panic_with_hook::h06a4e01a02150fc1
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:702:17
  12:     0x7f31e76a1437 - std::panicking::begin_panic_handler::{{closure}}::h376c0b0d176b15fb
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:588:13
  13:     0x7f31e769e704 - std::sys_common::backtrace::__rust_end_short_backtrace::hb6064a5b72d04bd2
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7f31e76a1169 - rust_begin_unwind
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/panicking.rs:584:5
  15:     0x7f31e7666373 - core::panicking::panic_fmt::h18f352cc18da6352
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/core/src/panicking.rs:142:14
  16:     0x55a57c7c2d90 - <rustdoc[325768d69b163fb7]::json::JsonRenderer as rustdoc[325768d69b163fb7]::formats::renderer::FormatRenderer>::item
  17:     0x55a57c7bc4a9 - <rustdoc[325768d69b163fb7]::json::JsonRenderer as rustdoc[325768d69b163fb7]::formats::renderer::FormatRenderer>::item
  18:     0x55a57c737cca - rustdoc[325768d69b163fb7]::formats::renderer::run_format::<rustdoc[325768d69b163fb7]::json::JsonRenderer>
  19:     0x55a57c511e32 - rustdoc[325768d69b163fb7]::run_renderer::<rustdoc[325768d69b163fb7]::json::JsonRenderer>
  20:     0x55a57c7644bb - <rustc_session[350565c454728d1f]::session::Session>::time::<core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>, rustdoc[325768d69b163fb7]::main_options::{closure#0}::{closure#0}::{closure#1}::{closure#2}>
  21:     0x55a57c6fdcc7 - <rustc_interface[823eb738556b78ea]::passes::QueryContext>::enter::<rustdoc[325768d69b163fb7]::main_options::{closure#0}::{closure#0}::{closure#1}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>
  22:     0x55a57c60083a - <rustc_interface[823eb738556b78ea]::interface::Compiler>::enter::<rustdoc[325768d69b163fb7]::main_options::{closure#0}::{closure#0}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>
  23:     0x55a57c7faaf6 - rustc_span[b519e1d6b7be61e8]::with_source_map::<core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>, rustc_interface[823eb738556b78ea]::interface::create_compiler_and_run<core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>, rustdoc[325768d69b163fb7]::main_options::{closure#0}>::{closure#1}>
  24:     0x55a57c629bc1 - rustc_interface[823eb738556b78ea]::interface::create_compiler_and_run::<core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>, rustdoc[325768d69b163fb7]::main_options::{closure#0}>
  25:     0x55a57c4dfb07 - <scoped_tls[dfe53452cd62d879]::ScopedKey<rustc_span[b519e1d6b7be61e8]::SessionGlobals>>::set::<rustdoc[325768d69b163fb7]::main_args::{closure#0}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>
  26:     0x55a57c62ae7f - std[8de092468d8aceba]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[823eb738556b78ea]::util::run_in_thread_pool_with_globals<rustdoc[325768d69b163fb7]::main_args::{closure#0}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>::{closure#0}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>
  27:     0x55a57c719699 - <<std[8de092468d8aceba]::thread::Builder>::spawn_unchecked_<rustc_interface[823eb738556b78ea]::util::run_in_thread_pool_with_globals<rustdoc[325768d69b163fb7]::main_args::{closure#0}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>::{closure#0}, core[47d7e3b58a64b363]::result::Result<(), rustc_errors[61501852ee8eeabe]::ErrorGuaranteed>>::{closure#1} as core[47d7e3b58a64b363]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  28:     0x7f31e76ab523 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h68a1c90dcd11ebd9
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/alloc/src/boxed.rs:1951:9
  29:     0x7f31e76ab523 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he92bdcacbb726b3b
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/alloc/src/boxed.rs:1951:9
  30:     0x7f31e76ab523 - std::sys::unix::thread::Thread::new::thread_start::hb6f32585ac3785d3
                               at /rustc/c08b235a5ce10167632bb0fddcd0c5d67f2d42e3/library/std/src/sys/unix/thread.rs:108:17
  31:     0x7f31e747f54d - <unknown>
  32:     0x7f31e7504b14 - clone
  33:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.63.0-nightly (c08b235a5 2022-06-11) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z unstable-options

query stack during panic:
end of query stack

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

Enselic commented Jun 12, 2022

@rustbot labels +A-rustdoc-json

@rustbot rustbot added the A-rustdoc-json Area: Rustdoc JSON backend label Jun 12, 2022
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Jun 12, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 23, 2022
…, r=notriddle

Fixes handling of keywords in rustdoc json output

Fixes rust-lang#98002.

Instead of panicking, we just filter them out.

cc `@matthiaskrgr`
r? `@notriddle`
compiler-errors added a commit to compiler-errors/rust that referenced this issue Jun 23, 2022
…, r=notriddle

Fixes handling of keywords in rustdoc json output

Fixes rust-lang#98002.

Instead of panicking, we just filter them out.

cc ``@matthiaskrgr``
r? ``@notriddle``
@bors bors closed this as completed in 5620983 Jun 24, 2022
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. glacier ICE tracked in rust-lang/glacier. 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.

4 participants