Skip to content

Nigtly panic on optional unwrap #121707

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
dr-orlovsky opened this issue Feb 27, 2024 · 3 comments
Closed

Nigtly panic on optional unwrap #121707

dr-orlovsky opened this issue Feb 27, 2024 · 3 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@dr-orlovsky
Copy link

Code

It is not clear whether specifically compiler fails, but it happens during compilation of the following crate:

cargo +nightly install commit_verify --version 0.11.0-beta.4 --all-features

Meta

rustc --version --verbose:

rustc 1.78.0-nightly (fc3800f65 2024-02-26)
binary: rustc
commit-hash: fc3800f65777a365b5125706d60f97e4d0675efe
commit-date: 2024-02-26
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0

Error output

In the attached file
rustc-ice-2024-02-27T21_35_46-630453.txt

Backtrace

thread 'rustc' panicked at compiler/rustc_ast_lowering/src/lib.rs:962:56:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
             at /rustc/fc3800f65777a365b5125706d60f97e4d0675efe/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/fc3800f65777a365b5125706d60f97e4d0675efe/library/core/src/panicking.rs:72:14
   2: core::panicking::panic
             at /rustc/fc3800f65777a365b5125706d60f97e4d0675efe/library/core/src/panicking.rs:144:5
   3: core::option::unwrap_failed
             at /rustc/fc3800f65777a365b5125706d60f97e4d0675efe/library/core/src/option.rs:1985:5
   4: <rustc_ast_lowering::LoweringContext>::lower_attrs
   5: <rustc_ast_lowering::LoweringContext>::lower_assoc_item
   6: <rustc_ast_lowering::item::ItemLowerer>::lower_node
   7: rustc_ast_lowering::lower_to_hir
      [... omitted 2 frames ...]
   8: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>>>
   9: <rustc_middle::hir::map::Map>::get_module
  10: rustc_middle::hir::map::hir_crate_items
      [... omitted 1 frame ...]
  11: rustc_interface::proc_macro_decls::proc_macro_decls_static
      [... omitted 1 frame ...]
  12: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  13: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C strip=debuginfo

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

query stack during panic:
#0 [hir_crate] getting the crate HIR
#1 [opt_hir_owner_nodes] getting HIR owner items in ``
#2 [hir_crate_items] getting HIR crate items
#3 [proc_macro_decls_static] looking up the proc macro declarations for a crate
#4 [analysis] running analysis passes on this crate
end of query stack

@dr-orlovsky dr-orlovsky 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 27, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 27, 2024
@jieyouxu jieyouxu added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Feb 27, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Feb 28, 2024

Reduced rustc 1.78.0-nightly (0ecbd0605 2024-02-25) via cargo-minimize + hand-reduction:

trait Foo {
    #[doc=hidden]
    fn foo();
}

Does not crash on stable or beta.

@jieyouxu jieyouxu added S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue and removed E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Feb 28, 2024
@jieyouxu
Copy link
Member

searched nightlies: from nightly-2024-02-10 to nightly-2024-02-16
regressed nightly: nightly-2024-02-16
searched commit range: ee9c7c9...a447249
regressed commit: cbddf31

bisected with cargo-bisect-rustc v0.6.8

Host triple: x86_64-apple-darwin
Reproduce with:

cargo bisect-rustc --start=2024-02-10 --end=2024-02-16

@jieyouxu
Copy link
Member

jieyouxu commented Feb 28, 2024

Thanks for the report, this is a duplicate of #121537.

@jieyouxu jieyouxu closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2024
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 29, 2024
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) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants