Skip to content

ICE: 'compiler/rustc_interface/src/interface.rs:181:45: shoudn't be possible' #111291

Closed
@taiki-e

Description

@taiki-e

Code

// src/lib.rs
// (can be reproduced with an empty crate)

Run RUSTFLAGS='-Z unstable-options --check-cfg=names(a) --check-cfg=values(a,"b")' cargo build

It works if the order of --check-cfg=names and -check-cfg=values is swapped. (e.i., RUSTFLAGS='-Z unstable-options --check-cfg=values(a,"b") --check-cfg=names(a)' cargo build)

Meta

rustc --version --verbose:

rustc 1.71.0-nightly (f9a6b7158 2023-05-05)
binary: rustc
commit-hash: f9a6b71580cd53dd4491d9bb6400f7ee841d9c22
commit-date: 2023-05-05
host: aarch64-apple-darwin
release: 1.71.0-nightly
LLVM version: 16.0.2

Error output

error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/Users/taiki/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/rustc - --crate-name ___ --print=file-names -Z unstable-options '--check-cfg=names(a)' '--check-cfg=values(a,"b")' --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'compiler/rustc_interface/src/interface.rs:181:45: shoudn't be possible', compiler/rustc_middle/src/util/bug.rs:36:26
  stack backtrace:
     0: std::panicking::begin_panic::<alloc::string::String>
     1: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
     2: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
     3: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
     4: rustc_middle::util::bug::bug_fmt
     5: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::with::<rustc_interface::interface::parse_check_cfg::{closure#0}, rustc_session::config::CheckCfg>
     6: rustc_interface::interface::parse_check_cfg
     7: <rustc_driver_impl::RunCompiler>::run
     8: <core::panic::unwind_safe::AssertUnwindSafe<rustc_driver_impl::main::{closure#0}> as core::ops::function::FnOnce<()>>::call_once
     9: rustc_driver_impl::main
    10: rustc_main::main
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

  error: 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.71.0-nightly (f9a6b7158 2023-05-05) running on aarch64-apple-darwin

  note: compiler flags: -Z unstable-options --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro

  query stack during panic:
  end of query stack

The backtrace points to the line added in #111068.
cc @Urgau


@rustbot label +requires-nightly

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions