Skip to content

rustdoc ICE 'Deref section without derived id' #81395

Closed
@SimonSapin

Description

@SimonSapin

Code

Original:

git clone https://gitlab.freedesktop.org/gstreamer/gstreamer-rs
cd gstreamer-rs
RUST_BACKTRACE=1 cargo +nightly doc -p gstreamer-video --no-deps

Minimized:

pub struct Generic<T>(T);

impl<'a> std::ops::Deref for Generic<&'a mut ()> {
    type Target = Generic<&'a ()>;
    fn deref(&self) -> &Self::Target {
        unimplemented!()
    }
}

impl<'a> Generic<&'a ()> {
    pub fn some_method(&self) {}
}

Meta

rustc +nightly --version --verbose:

rustc 1.51.0-nightly (1d0d76f8d 2021-01-24)
binary: rustc
commit-hash: 1d0d76f8dd4f5f6ecbeab575b87edaf1c9f56bb8
commit-date: 2021-01-24
host: x86_64-unknown-linux-gnu
release: 1.51.0-nightly
LLVM version: 11.0.1

Error output

 Documenting gstreamer-video v0.17.0 (/home/simon/projects/servo-deps/gstreamer-rs/gstreamer-video)
thread 'rustc' panicked at 'Deref section without derived id', src/librustdoc/html/render/mod.rs:4427:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

error: Unrecognized option: 'crate-version'

error: could not document `gstreamer-video`
Backtrace

thread 'rustc' panicked at 'Deref section without derived id', src/librustdoc/html/render/mod.rs:4427:22
stack backtrace:
   0: rust_begin_unwind
             at /rustc/1d0d76f8dd4f5f6ecbeab575b87edaf1c9f56bb8/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/1d0d76f8dd4f5f6ecbeab575b87edaf1c9f56bb8/library/core/src/panicking.rs:92:14
   2: core::option::expect_failed
             at /rustc/1d0d76f8dd4f5f6ecbeab575b87edaf1c9f56bb8/library/core/src/option.rs:1258:5
   3: rustdoc::html::render::sidebar_deref_methods
   4: rustdoc::html::render::sidebar_assoc_items
   5: rustdoc::html::render::print_sidebar
   6: rustdoc::html::layout::render
   7: rustdoc::html::render::Context::render_item
   8: <rustdoc::html::render::Context as rustdoc::formats::renderer::FormatRenderer>::item
   9: rustdoc::formats::renderer::run_format
  10: rustdoc::run_renderer
  11: rustc_session::utils::<impl rustc_session::session::Session>::time
  12: rustc_interface::passes::QueryContext::enter
  13: rustc_interface::interface::create_compiler_and_run
  14: rustdoc::main_options
  15: scoped_tls::ScopedKey<T>::set

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions