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 Internal Compiler Error for Diesel #107995

Closed
weiznich opened this issue Feb 13, 2023 · 13 comments · Fixed by #108129
Closed

Rustdoc Internal Compiler Error for Diesel #107995

weiznich opened this issue Feb 13, 2023 · 13 comments · Fixed by #108129
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@weiznich
Copy link
Contributor

Code

git clone https://github.com/diesel-rs/diesel
cd diesel 
git checkout 0c8a87713 # current master branch
cargo doc --manifest-path diesel/Cargo.toml --features "postgres sqlite mysql extras i-implement-a-third-party-backend-and-opt-into-breaking-changes" --workspace

Meta

rustc --version --verbose:

rustc 1.69.0-nightly (5b8f28453 2023-02-12)

Error output

thread 'rustc' panicked at 'no resolution for "LoadRowIter" MacroNS DefId(0:181 ~ diesel[46ea]::connection)', src/librustdoc/passes/collect_intra_doc_links.rs:393:32
stack backtrace:
   0:     0x7fdfa9b8803a - std::backtrace_rs::backtrace::libunwind::trace::h68819555df8b2d9c
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fdfa9b8803a - std::backtrace_rs::backtrace::trace_unsynchronized::hd69f04a0acc016b0
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fdfa9b8803a - std::sys_common::backtrace::_print_fmt::hd05f5f45b3abc36d
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fdfa9b8803a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h97505bc956055c86
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fdfa9be821e - core::fmt::write::hee40881876785ec8
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/core/src/fmt/mod.rs:1232:17
   5:     0x7fdfa9b78755 - std::io::Write::write_fmt::h9ac4fb15bcdd983e
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/io/mod.rs:1684:15
   6:     0x7fdfa9b87e05 - std::sys_common::backtrace::_print::h7b79888859e1041b
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7fdfa9b87e05 - std::sys_common::backtrace::print::h5f377a03e09d721c
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7fdfa9b8ab9f - std::panicking::default_hook::{{closure}}::h081dc35da89fae25
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/panicking.rs:267:22
   9:     0x7fdfa9b8a8db - std::panicking::default_hook::h5ac9a56440f0f320
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/panicking.rs:286:9
  10:     0x7fdfacee4144 - rustc_driver_impl[45704de6fc1a7e42]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fdfa9b8b3da - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h597f484af91b69d8
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/alloc/src/boxed.rs:2002:9
  12:     0x7fdfa9b8b3da - std::panicking::rust_panic_with_hook::h32591b11d4f9c8c2
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/panicking.rs:692:13
  13:     0x7fdfa9b8b159 - std::panicking::begin_panic_handler::{{closure}}::hb2b75e52ec6963d4
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/panicking.rs:579:13
  14:     0x7fdfa9b884dc - std::sys_common::backtrace::__rust_end_short_backtrace::ha859a147e693367c
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/sys_common/backtrace.rs:137:18
  15:     0x7fdfa9b8ae62 - rust_begin_unwind
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/panicking.rs:575:5
  16:     0x7fdfa9be4bc3 - core::panicking::panic_fmt::hb9e85c5c10f5beb5
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/core/src/panicking.rs:64:14
  17:     0x5592c323b52f - <rustdoc[e05275ab24b811c1]::passes::collect_intra_doc_links::LinkCollector>::resolve_path
  18:     0x5592c323b662 - <rustdoc[e05275ab24b811c1]::passes::collect_intra_doc_links::LinkCollector>::resolve
  19:     0x5592c32401a9 - <rustdoc[e05275ab24b811c1]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e05275ab24b811c1]::visit::DocVisitor>::visit_item
  20:     0x5592c324d46a - <rustdoc[e05275ab24b811c1]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e05275ab24b811c1]::visit::DocVisitor>::visit_inner_recur
  21:     0x5592c3242f1f - <rustdoc[e05275ab24b811c1]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e05275ab24b811c1]::visit::DocVisitor>::visit_item
  22:     0x5592c324d42a - <rustdoc[e05275ab24b811c1]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e05275ab24b811c1]::visit::DocVisitor>::visit_inner_recur
  23:     0x5592c3242f05 - <rustdoc[e05275ab24b811c1]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e05275ab24b811c1]::visit::DocVisitor>::visit_item
  24:     0x5592c324d42a - <rustdoc[e05275ab24b811c1]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e05275ab24b811c1]::visit::DocVisitor>::visit_inner_recur
  25:     0x5592c3242f05 - <rustdoc[e05275ab24b811c1]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e05275ab24b811c1]::visit::DocVisitor>::visit_item
  26:     0x5592c3239fbf - rustdoc[e05275ab24b811c1]::passes::collect_intra_doc_links::collect_intra_doc_links
  27:     0x5592c31fa03e - <rustc_session[15418ad64be04b7e]::session::Session>::time::<rustdoc[e05275ab24b811c1]::clean::types::Crate, rustdoc[e05275ab24b811c1]::core::run_global_ctxt::{closure#7}>
  28:     0x5592c3277c5b - rustdoc[e05275ab24b811c1]::core::run_global_ctxt
  29:     0x5592c31fa32b - <rustc_session[15418ad64be04b7e]::session::Session>::time::<(rustdoc[e05275ab24b811c1]::clean::types::Crate, rustdoc[e05275ab24b811c1]::config::RenderOptions, rustdoc[e05275ab24b811c1]::formats::cache::Cache), rustdoc[e05275ab24b811c1]::main_args::{closure#1}::{closure#0}::{closure#1}::{closure#0}>
  30:     0x5592c303c71d - <rustc_interface[1dae503a51862634]::queries::QueryResult<&rustc_middle[950e6c013232a13e]::ty::context::GlobalCtxt>>::enter::<core[8fc858d2dd58175c]::result::Result<(), rustc_errors[9a7f2c558b529898]::ErrorGuaranteed>, rustdoc[e05275ab24b811c1]::main_args::{closure#1}::{closure#0}::{closure#1}>
  31:     0x5592c2fb2c8a - <rustc_interface[1dae503a51862634]::interface::Compiler>::enter::<rustdoc[e05275ab24b811c1]::main_args::{closure#1}::{closure#0}, core[8fc858d2dd58175c]::result::Result<(), rustc_errors[9a7f2c558b529898]::ErrorGuaranteed>>
  32:     0x5592c31f972b - rustc_span[9e92ed5877933bb8]::with_source_map::<core[8fc858d2dd58175c]::result::Result<(), rustc_errors[9a7f2c558b529898]::ErrorGuaranteed>, rustc_interface[1dae503a51862634]::interface::run_compiler<core[8fc858d2dd58175c]::result::Result<(), rustc_errors[9a7f2c558b529898]::ErrorGuaranteed>, rustdoc[e05275ab24b811c1]::main_args::{closure#1}>::{closure#0}::{closure#0}>
  33:     0x5592c3147462 - <scoped_tls[d2579b36b1a9f18d]::ScopedKey<rustc_span[9e92ed5877933bb8]::SessionGlobals>>::set::<rustc_interface[1dae503a51862634]::interface::run_compiler<core[8fc858d2dd58175c]::result::Result<(), rustc_errors[9a7f2c558b529898]::ErrorGuaranteed>, rustdoc[e05275ab24b811c1]::main_args::{closure#1}>::{closure#0}, core[8fc858d2dd58175c]::result::Result<(), rustc_errors[9a7f2c558b529898]::ErrorGuaranteed>>
  34:     0x5592c320dba0 - std[6e58747c831eadda]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[1dae503a51862634]::util::run_in_thread_pool_with_globals<rustc_interface[1dae503a51862634]::interface::run_compiler<core[8fc858d2dd58175c]::result::Result<(), rustc_errors[9a7f2c558b529898]::ErrorGuaranteed>, rustdoc[e05275ab24b811c1]::main_args::{closure#1}>::{closure#0}, core[8fc858d2dd58175c]::result::Result<(), rustc_errors[9a7f2c558b529898]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8fc858d2dd58175c]::result::Result<(), rustc_errors[9a7f2c558b529898]::ErrorGuaranteed>>
  35:     0x5592c3015b77 - <<std[6e58747c831eadda]::thread::Builder>::spawn_unchecked_<rustc_interface[1dae503a51862634]::util::run_in_thread_pool_with_globals<rustc_interface[1dae503a51862634]::interface::run_compiler<core[8fc858d2dd58175c]::result::Result<(), rustc_errors[9a7f2c558b529898]::ErrorGuaranteed>, rustdoc[e05275ab24b811c1]::main_args::{closure#1}>::{closure#0}, core[8fc858d2dd58175c]::result::Result<(), rustc_errors[9a7f2c558b529898]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8fc858d2dd58175c]::result::Result<(), rustc_errors[9a7f2c558b529898]::ErrorGuaranteed>>::{closure#1} as core[8fc858d2dd58175c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  36:     0x7fdfa9b95373 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hfe75deb0c10a09d3
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/alloc/src/boxed.rs:1988:9
  37:     0x7fdfa9b95373 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hcd4bdd69a317ae2f
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/alloc/src/boxed.rs:1988:9
  38:     0x7fdfa9b95373 - std::sys::unix::thread::Thread::new::thread_start::h1aad22be20900f56
                               at /rustc/5b8f284536d00ba649ca968584bedab4820d8527/library/std/src/sys/unix/thread.rs:108:17
  39:     0x7fdfa98b6b43 - <unknown>
  40:     0x7fdfa9948a00 - <unknown>
  41:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.
cargo bisect-rustc points to:https://github.com/rust-lang/rust/commit/5b450244876154bc1bd134694398e80c12e00b5c

searched nightlies: from nightly-2023-01-30 to nightly-2023-02-13
regressed nightly: nightly-2023-02-12
searched commit range: 2773383...585f3ee
regressed commit: 5b45024

@rustbot label +regression-from-stable-to-nightly +T-rustdoc

@weiznich weiznich 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 Feb 13, 2023
@rustbot rustbot added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Feb 13, 2023
@weiznich
Copy link
Contributor Author

cc @petrochenkov as author of #94857

@Noratrieb
Copy link
Member

Duplicate of #107990

@Noratrieb Noratrieb marked this as a duplicate of #107990 Feb 13, 2023
@Noratrieb Noratrieb added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Feb 13, 2023
@olivereanderson
Copy link

I have a similar problem. Steps to reproduce:

  1. cargo new --lib example
  2. cd example
  3. cargo add iota-types
  4. cargo +nightly doc
rustc +nightly --version -v
rustc 1.69.0-nightly (5b8f28453 2023-02-12)
binary: rustc
commit-hash: 5b8f284536d00ba649ca968584bedab4820d8527
commit-date: 2023-02-12
host: x86_64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.7

@petrochenkov petrochenkov self-assigned this Feb 13, 2023
@petrochenkov
Copy link
Contributor

cargo add iota-types

Same issue also reproduces when iota-types is documented directly, not as a dependency.

@petrochenkov
Copy link
Contributor

The link in iota-types looks like this

    /// Creates a new [ GovernorAddressUnlockCondition`].

, not the single backtick and also whitespace.

Looks like a mismatch in preprocessing the stuff inside [...] between rustc and rustdoc.

@petrochenkov
Copy link
Contributor

diesel link

    /// dsl on top of diesel. It returns an [ `LoadRowIter`], which

, extra whitespace.

@Kixunil
Copy link
Contributor

Kixunil commented Feb 13, 2023

Oh, yes, this reproduces:

/// A foo, see also [ bar`]
pub fn foo() {}

pub fn bar() {}

@Kixunil
Copy link
Contributor

Kixunil commented Feb 13, 2023

There's still something else going on since AFAICT there are no links in case of #107990

@petrochenkov
Copy link
Contributor

rust-bitcoin link

        #[doc = "The tag used for ["]
        #[doc = "TapLeafHash"]
        #[doc = "]"]

, extra newlines (?) after the doc strings are merged.

@Kixunil
Copy link
Contributor

Kixunil commented Feb 13, 2023

Oh, I was looking at the wrong macro, sorry. 🤦‍♂️

@petrochenkov
Copy link
Contributor

I'll try to fix all this stuff tomorrow.

@petrochenkov petrochenkov removed the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Feb 13, 2023
@apiraino
Copy link
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Feb 14, 2023
weiznich added a commit to weiznich/diesel that referenced this issue Feb 15, 2023
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 18, 2023
petrochenkov pushed a commit to petrochenkov/rust that referenced this issue Feb 19, 2023
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 19, 2023
…nks-starting-with-whitespace, r=petrochenkov

Correctly handle links starting with whitespace

Part of rust-lang#107995.

I just got this issue, wrote a fix and then saw the issue. So here's the PR. ^^'

r? `@petrochenkov`
@petrochenkov
Copy link
Contributor

Fixed in #108129.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. 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.

7 participants