Skip to content

(incremental?) ICE during rustc development #99448

Closed
@CAD97

Description

@CAD97

Minimizing from rustc is pretty impossible, and my attempts so far to deliberately provoke this didn't work. I initially got this error from the bootstrap/beta compiler while compiling rustdoc. This time it randomly happened again, but this time from my dev rustc on stage1 core.

It doesn't occur again after an x.py clean, thus the though that it is incremental metadata related.

trace
❯ x.py test src/test/ui/
Building rustbuild
   Compiling bootstrap v0.0.0 (D:\git\rust-lang\rust\src\bootstrap)
    Finished dev [unoptimized] target(s) in 2.99s
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   D:\git\rust-lang\rust\src\tools\miri\Cargo.toml
workspace: D:\git\rust-lang\rust\Cargo.toml
Building stage0 std artifacts (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc)
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   D:\git\rust-lang\rust\src\tools\miri\Cargo.toml
workspace: D:\git\rust-lang\rust\Cargo.toml
    Finished release [optimized] target(s) in 0.43s
Copying stage0 std from stage0 (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc / x86_64-pc-windows-msvc)
Warning: Using a potentially stale build of LLVM; This may not behave well.
Building stage0 compiler artifacts (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc)
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   D:\git\rust-lang\rust\src\tools\miri\Cargo.toml
workspace: D:\git\rust-lang\rust\Cargo.toml
   Compiling rustc_llvm v0.0.0 (D:\git\rust-lang\rust\compiler\rustc_llvm)
   Compiling rustc_resolve v0.0.0 (D:\git\rust-lang\rust\compiler\rustc_resolve)
   Compiling rustc_privacy v0.0.0 (D:\git\rust-lang\rust\compiler\rustc_privacy)
   Compiling rustc_codegen_llvm v0.0.0 (D:\git\rust-lang\rust\compiler\rustc_codegen_llvm)
   Compiling rustc_interface v0.0.0 (D:\git\rust-lang\rust\compiler\rustc_interface)
   Compiling rustc_driver v0.0.0 (D:\git\rust-lang\rust\compiler\rustc_driver)
   Compiling rustc_smir v0.0.0 (D:\git\rust-lang\rust\compiler\rustc_smir)
   Compiling rustc-main v0.0.0 (D:\git\rust-lang\rust\compiler\rustc)
    Finished release [optimized] target(s) in 3m 00s
Copying stage0 rustc from stage0 (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc / x86_64-pc-windows-msvc)
Assembling stage1 compiler (x86_64-pc-windows-msvc)
Building stage1 std artifacts (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc)
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   D:\git\rust-lang\rust\src\tools\miri\Cargo.toml
workspace: D:\git\rust-lang\rust\Cargo.toml
   Compiling cc v1.0.69
   Compiling core v0.0.0 (D:\git\rust-lang\rust\library\core)
   Compiling libc v0.2.126
   Compiling memchr v2.4.1
   Compiling std v0.0.0 (D:\git\rust-lang\rust\library\std)
thread 'rustc' panicked at 'no entry found for key', compiler\rustc_resolve\src\build_reduced_graph.rs:174:13
stack backtrace:
   1: core::panicking::panic_fmt
   2: core::slice::memchr::memrchr
   3: core::slice::memchr::memrchr
   4: core::option::expect_failed
   5: <rustc_resolve::Resolver>::expn_def_scope
   6: <rustc_resolve::Resolver>::expn_def_scope
   7: <rustc_resolve::Resolver>::resolve_crate_root
   8: RINvXs0_NtNtNtCs6TVTQEf0OfU_4core4iter8adapters3mapINtB6_3MapINtNtNtBc_3ops5range5RangejENCINvNtCsaHTWEQErQCC_10rustc_span7hygiene25update_dollar_crate_namesNCNvXNtCslDngFg3lzQK_13rustc_resolve6macrosNtB2C_8ResolverNtNtCsibRkcvbe1JZ_12rustc_expand4base14R
   9: RNvXNtNtCs5eSxxdxoKEq_5alloc3vec14spec_from_iterINtB4_3VecNtNtCsaHTWEQErQCC_10rustc_span6symbol6SymbolEINtB2_12SpecFromIterBU_INtNtNtNtCs6TVTQEf0OfU_4core4iter8adapters3map3MapINtNtNtB29_3ops5range5RangejENCINvNtBY_7hygiene25update_dollar_crate_namesNCNvX
  10: rustc_span::hygiene::update_dollar_crate_names::<<rustc_resolve::Resolver as rustc_expand::base::ResolverExpand>::resolve_dollar_crates::{closure#0}>
  11: <rustc_expand::expand::MacroExpander>::fully_expand_fragment
  12: <rustc_expand::expand::MacroExpander>::fully_expand_fragment
  13: rustc_expand::base::expr_to_spanned_string
  14: rustc_expand::base::get_single_str_from_tts
  15: rustc_builtin_macros::source_util::expand_include_str
  16: <rustc_expand::expand::MacroExpander>::fully_expand_fragment
  17: <rustc_expand::expand::MacroExpander>::expand_crate
  18: RINvMNtCsiHnDGx59jrk_13rustc_session5utilsNtNtB5_7session7Session4timeINtNtCs6TVTQEf0OfU_4core6result6ResultNtNtCsdRvVQKGB0d0_9rustc_ast3ast5CrateNtCs80gEZftADfn_12rustc_errors15ErrorGuaranteedENCNvNtCsbBevGOJpmRD_15rustc_interface6passes20configure_and_e
  19: rustc_interface::passes::configure_and_expand
  20: RINvMs_NtNtCsbBevGOJpmRD_15rustc_interface6passes14boxed_resolverNtB5_13BoxedResolver6accessNCNCNvMs0_NtB9_7queriesNtB1C_7Queries9expansion00INtNtCs6TVTQEf0OfU_4core6result6ResultNtNtCsdRvVQKGB0d0_9rustc_ast3ast5CrateNtCs80gEZftADfn_12rustc_errors15ErrorG
  21: RINvMNtCsbBevGOJpmRD_15rustc_interface7queriesINtB3_5QueryTINtNtCs5eSxxdxoKEq_5alloc2rc2RcNtNtCsdRvVQKGB0d0_9rustc_ast3ast5CrateEIBW_INtNtCs6TVTQEf0OfU_4core4cell7RefCellNtNtNtB5_6passes14boxed_resolver13BoxedResolverEEIBW_NtNtCs99l6P3Si7SV_10rustc_lint7c
  22: <rustc_interface::queries::Queries>::expansion
  23: RINvMs2_NtCsbBevGOJpmRD_15rustc_interface7queriesNtNtB8_9interface8Compiler5enterNCNCNvCs3oRkvP7tkTP_12rustc_driver12run_compilers_0s0_0INtNtCs6TVTQEf0OfU_4core6result6ResultINtNtB2f_6option6OptionNtB6_6LinkerENtCs80gEZftADfn_12rustc_errors15ErrorGuarante
  24: RINvCsaHTWEQErQCC_10rustc_span15with_source_mapINtNtCs6TVTQEf0OfU_4core6result6ResultuNtCs80gEZftADfn_12rustc_errors15ErrorGuaranteedENCINvNtCsbBevGOJpmRD_15rustc_interface9interface23create_compiler_and_runBJ_NCNvCs3oRkvP7tkTP_12rustc_driver12run_compile
  25: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
  26: RINvMs_Csd9upP95a9XL_10scoped_tlsINtB5_9ScopedKeyNtCsaHTWEQErQCC_10rustc_span14SessionGlobalsE3setNCINvNtCsbBevGOJpmRD_15rustc_interface9interface12run_compilerINtNtCs6TVTQEf0OfU_4core6result6ResultuNtCs80gEZftADfn_12rustc_errors15ErrorGuaranteedENCNvCs3o
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.64.0-dev running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -Z unstable-options -C incremental -C symbol-mangling-version=legacy -Z unstable-options -Z unstable-options -Z macro-backtrace -C target-feature=+crt-static -C prefer-dynamic -C llvm-args=-import-instr-limit=10 -C embed-bitcode=yes -Z crate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/") -Z binary-dep-depinfo -Z force-unstable-if-unmarked

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

query stack during panic:
end of query stack
   Compiling compiler_builtins v0.1.73
   Compiling unwind v0.0.0 (D:\git\rust-lang\rust\library\unwind)
error: could not compile `core`

Caused by:
  process didn't exit successfully: `D:\git\rust-lang\rust\build\bootstrap\debug\rustc --crate-name core --edition=2021 library\core\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -Zunstable-options --check-cfg names() --check-cfg values() -C metadata=7a8ae34f67ccc69f -C extra-filename=-7a8ae34f67ccc69f --out-dir D:\git\rust-lang\rust\build\x86_64-pc-windows-msvc\stage1-std\x86_64-pc-windows-msvc\release\deps --target x86_64-pc-windows-msvc -C incremental=D:\git\rust-lang\rust\build\x86_64-pc-windows-msvc\stage1-std\x86_64-pc-windows-msvc\release\incremental -L dependency=D:\git\rust-lang\rust\build\x86_64-pc-windows-msvc\stage1-std\x86_64-pc-windows-msvc\release\deps -L dependency=D:\git\rust-lang\rust\build\x86_64-pc-windows-msvc\stage1-std\release\deps -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options --check-cfg=values(bootstrap) --check-cfg=values(stdarch_intel_sde) --check-cfg=values(no_fp_fmt_parse) --check-cfg=values(no_global_oom_handling) --check-cfg=values(freebsd12) --check-cfg=values(backtrace_in_libstd) "--check-cfg=values(target_env,\"libnx\")" "--check-cfg=values(target_os,\"watchos\")" "--check-cfg=values(target_arch,\"asmjs\",\"spirv\",\"nvptx\",\"nvptx64\",\"le32\",\"xtensa\")" --check-cfg=values(dont_compile_me) -Zmacro-backtrace -Ctarget-feature=+crt-static -Cprefer-dynamic -Cllvm-args=-import-instr-limit=10 -Cembed-bitcode=yes "-Zcrate-attr=doc(html_root_url=\"https://doc.rust-lang.org/nightly/\")" -Z binary-dep-depinfo` (exit code: 0x80000003)

Metadata

Metadata

Assignees

No one assigned

    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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions