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

ICE: rustdoc unwrap None when documenting dependency with GATs #94009 #94683

Closed
MingweiSamuel opened this issue Mar 6, 2022 · 2 comments · Fixed by #94684
Closed

ICE: rustdoc unwrap None when documenting dependency with GATs #94009 #94683

MingweiSamuel opened this issue Mar 6, 2022 · 2 comments · Fixed by #94684
Assignees
Labels
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.

Comments

@MingweiSamuel
Copy link
Contributor

MingweiSamuel commented Mar 6, 2022

Code

Code here, big project, but only need to run -p kvs or -p relalg to cause the error. Maybe will try to minimize later.
hydro-project/hydroflow@d39d44d

Minimized example: https://github.com/MingweiSamuel/rustdoc-ice

my_dependency/src/lib.rs

#![feature(generic_associated_types)]

pub trait MyTrait {
    type MyGat<'s>
    where
        Self: 's;
    fn my_fn(&self) -> Self::MyGat<'_>;
}

impl MyTrait for () {
    type MyGat<'s> = &'s ();
    fn my_fn(&self) -> Self::MyGat<'_> {
        &()
    }
}

my_package/src/lib.rs

use my_dependency;

Command:

cargo doc

Meta

Error output

See backtrace

Backtrace

$ cargo doc
    Checking my_dependency v0.1.0 (D:\Projects\rustdoc-ice\my_dependency)
 Documenting my_dependency v0.1.0 (D:\Projects\rustdoc-ice\my_dependency)
 Documenting my_package v0.1.0 (D:\Projects\rustdoc-ice\my_package)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src\librustdoc\clean\mod.rs:409:59
stack backtrace:
   0:     0x7ff999ab9740 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1b60d32e13dca2c0
   1:     0x7ff999aef5ba - core::fmt::write::h956db761fb8891bc
   2:     0x7ff999aabe99 - <std::io::IoSliceMut as core::fmt::Debug>::fmt::h8bae511bb1c52660
   3:     0x7ff999abcd0b - std::panicking::default_hook::h400a469cdf1f53e7
   4:     0x7ff999abc8ec - std::panicking::default_hook::h400a469cdf1f53e7
   5:     0x7ff9912b9726 - rustc_driver[96d5aea7497e3b44]::pretty::print_after_hir_lowering
   6:     0x7ff999abd5eb - std::panicking::rust_panic_with_hook::haf3e9c505f20c32c
   7:     0x7ff999abd302 - <std::panicking::begin_panic_handler::StrPanicPayload as core::panic::BoxMeUp>::get::hf200192ef50e8b12
   8:     0x7ff999aba057 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1b60d32e13dca2c0
   9:     0x7ff999abd019 - rust_begin_unwind
  10:     0x7ff999b22ab5 - core::panicking::panic_fmt::h600d95c087b9120e
  11:     0x7ff999b2295c - core::panicking::panic::h4922a2ba3330589b
  12:     0x7ff6c097a9ce - <unknown>
  13:     0x7ff6c09d5355 - <unknown>
  14:     0x7ff6c0b340ef - <unknown>
  15:     0x7ff6c0923cb4 - <unknown>
  16:     0x7ff6c0af4249 - <unknown>
  17:     0x7ff6c0b373b4 - <unknown>
  18:     0x7ff6c0995c86 - <unknown>
  19:     0x7ff6c09d9d88 - <unknown>
  20:     0x7ff6c0a89f50 - <unknown>
  21:     0x7ff6c0a9c98b - <unknown>
  22:     0x7ff6c0924e41 - <unknown>
  23:     0x7ff6c0ae2059 - <unknown>
  24:     0x7ff6c0aa162e - <unknown>
  25:     0x7ff6c08e5332 - <unknown>
  26:     0x7ff6c0b4ccf5 - <unknown>
  27:     0x7ff6c0a5936c - <unknown>
  28:     0x7ff6c0b4fd0f - <unknown>
  29:     0x7ff6c084ba08 - <unknown>
  30:     0x7ff6c0b74247 - <unknown>
  31:     0x7ff6c08b7168 - <unknown>
  32:     0x7ff999acc6dc - std::sys::windows::thread::Thread::new::h0128d9e8937707db
  33:     0x7ffa02817034 - BaseThreadInitThunk
  34:     0x7ffa02c02651 - RtlUserThreadStart

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.61.0-nightly (c274e4969 2022-03-05) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not document `my_package`

Caused by:
  process didn't exit successfully: `rustdoc --edition=2021 --crate-type lib --crate-name my_package 'my_package\src\lib.rs' -o 'D:\Projects\rustdoc-ice\target\doc' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat -C metadata=3198935b0623bdb3 -L 'dependency=D:\Projects\rustdoc-ice\target\debug\deps' --extern 'my_dependency=D:\Projects\rustdoc-ice\target\debug\deps\libmy_dependency-190dee38e23bdfd7.rmeta' --crate-version 0.1.0` 
(exit code: 101)

@MingweiSamuel MingweiSamuel 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 Mar 6, 2022
@MingweiSamuel MingweiSamuel changed the title ICE: rustdoc GATs unwrap None #94009 ICE: rustdoc unwrap None #94009 Mar 6, 2022
@MingweiSamuel MingweiSamuel changed the title ICE: rustdoc unwrap None #94009 ICE: rustdoc unwrap None when documenting dependency with GATs #94009 Mar 6, 2022
@compiler-errors
Copy link
Member

I'll look into it!

@rustbot claim

@compiler-errors
Copy link
Member

Minimized this to a local-crate-only test, and working on a solution currently:

#![feature(generic_associated_types)]

pub trait Trait {
    type Gat<'a>;
}

pub type T = fn(&<() as Trait>::Gat<'_>);

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) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants