Skip to content

Conversation

reddevilmidzy
Copy link
Contributor

Fixes: #127424

This ICE no longer reproduces, so it appears to have already been fixed.
This PR adds a regression test to ensure the issue doesn’t come back in the future.

Please let me know if there's anything I should improve or revise!

@rustbot
Copy link
Collaborator

rustbot commented Apr 10, 2025

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 10, 2025
@jieyouxu
Copy link
Member

Not familiar with this, cc @camelid or @BoxyUwU in case there's already a simplified test for this.

@petrochenkov
Copy link
Contributor

It seems like this ICE has already been fixed. (Maybe #125915..?) I'd like to add a regression test to ensure it doesn't come back! 😀

That ICE only reproduces when the tested compiler is built with debug assertions ([rust] debug-assertions = true in bootstrap.toml).
@reddevilmidzy Did you try to reproduce it locally?

I'd suggest to avoid the off-topic "cannot find function/value" errors in the test, but it's hard to do without breaking the test if you don't have a reliable reproduction.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 10, 2025
@reddevilmidzy
Copy link
Contributor Author

Thanks for the feedback!

I couldn’t reproduce the ICE before, but after enabling [rust] debug-assertions = true in bootstrap.toml (and config.toml) as you suggested and checking out the 1.79.0 tag, I was finally able to reproduce it locally.

Specifically, running the following code triggered the same ICE as before:

fn bar() -> impl Into<
    [u8; {
        let _ = for<'a, 'b> |x: &'a &'a Vec<&'b u32>, b: bool| -> &'a Vec<&'b u32> { *x };
    }],
> {
    [89]
}

Version information

comand: .\build\x86_64-pc-windows-msvc\stage1\bin\rustc -vV

rustc 1.79.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-pc-windows-msvc
release: 1.79.0-dev
LLVM version: 18.1.7
Program output
error[E0658]: `for<...>` binders for closures are experimental
  --> \rust\tests\ui\const-generics\generic_const_exprs\const-generics-closure.rs:3:17
   |
LL |         let _ = for<'a, 'b> |x: &'a &'a Vec<&'b u32>, b: bool| -> &'a Vec<&'b u32> { *x };
   |                 ^^^^^^^^^^^
   |
   = note: see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information
   = help: add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
   = help: consider removing `for<...>`

thread 'rustc' panicked at compiler\rustc_ast_lowering\src\item.rs:63:13:
assertion failed: matches!(owner, hir::MaybeOwner::Phantom)
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: <[rustc_span::symbol::Symbol] as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
   4: <rustc_ast_lowering::item::ItemLowerer>::lower_node
   5: rustc_ast_lowering::lower_to_hir
      [... omitted 2 frames ...]
   6: <&alloc::ffi::c_str::NulError as core::fmt::Debug>::fmt
      [... omitted 2 frames ...]
   7: 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]>>>
   8: <rustc_middle::hir::map::Map>::get_module
   9: rustc_middle::hir::map::hir_crate_items
      [... omitted 2 frames ...]
  10: rustc_passes::hir_id_validator::check_crate
  11: rustc_interface::passes::create_global_ctxt
      [... omitted 2 frames ...]
  12: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure#3}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  13: RINvMs5_NtCs28QS2y6sdmQ_15rustc_interface7queriesNtNtB8_9interface8Compiler5enterNCNCNvCsdC0HzHJV9fq_17rustc_driver_impl12run_compiler0s_0INtNtCskla7WpyKoL0_4core6result6ResultINtNtB2h_6option6OptionNtB6_6LinkerENtCsjQRpMF1Y0aY_10rustc_span15ErrorGuarante
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: please make sure that you have updated to the latest nightly

note: rustc 1.79.0-dev running on x86_64-pc-windows-msvc

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=\.cargo -Z ignore-directory-in-diagnostics-source-blocks=\rust\vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0

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 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0658`.

I also cleaned up the test to remove the unrelated "cannot find function/value" errors while preserving the ICE.

let me know if anything else needs to be adjusted!

@petrochenkov

@petrochenkov
Copy link
Contributor

r=me after adding fn main #139607 (comment).

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 12, 2025
@petrochenkov
Copy link
Contributor

Thanks!

@petrochenkov
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 12, 2025

📌 Commit 11256a0 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 12, 2025
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Apr 12, 2025
… r=petrochenkov

Add regression test for rust-lang#127424

Fixes: rust-lang#127424

This ICE no longer reproduces, so it appears to have already been fixed.
This PR adds a regression test to ensure the issue doesn’t come back in the future.

Please let me know if there's anything I should improve or revise!
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 12, 2025
…enton

Rollup of 9 pull requests

Successful merges:

 - rust-lang#137494 (libstd: init(): dup() subsequent /dev/nulls instead of opening them again)
 - rust-lang#138881 (Use the chaining methods on PartialOrd for slices too)
 - rust-lang#138972 (std: Fix build for NuttX targets)
 - rust-lang#139107 (std: make `cmath` functions safe)
 - rust-lang#139607 (Add regression test for rust-lang#127424)
 - rust-lang#139691 (Document that `opt-dist` requires metrics to be enabled)
 - rust-lang#139707 (Fix comment in bootstrap)
 - rust-lang#139708 (Fix name of field in doc comment)
 - rust-lang#139709 (bootstrap: fix typo in doc string)

r? `@ghost`
`@rustbot` modify labels: rollup
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Apr 12, 2025
… r=petrochenkov

Add regression test for rust-lang#127424

Fixes: rust-lang#127424

This ICE no longer reproduces, so it appears to have already been fixed.
This PR adds a regression test to ensure the issue doesn’t come back in the future.

Please let me know if there's anything I should improve or revise!
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 13, 2025
…enton

Rollup of 8 pull requests

Successful merges:

 - rust-lang#138881 (Use the chaining methods on PartialOrd for slices too)
 - rust-lang#138972 (std: Fix build for NuttX targets)
 - rust-lang#139107 (std: make `cmath` functions safe)
 - rust-lang#139607 (Add regression test for rust-lang#127424)
 - rust-lang#139691 (Document that `opt-dist` requires metrics to be enabled)
 - rust-lang#139707 (Fix comment in bootstrap)
 - rust-lang#139708 (Fix name of field in doc comment)
 - rust-lang#139709 (bootstrap: fix typo in doc string)

r? `@ghost`
`@rustbot` modify labels: rollup
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Apr 13, 2025
… r=petrochenkov

Add regression test for rust-lang#127424

Fixes: rust-lang#127424

This ICE no longer reproduces, so it appears to have already been fixed.
This PR adds a regression test to ensure the issue doesn’t come back in the future.

Please let me know if there's anything I should improve or revise!
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 13, 2025
…enton

Rollup of 7 pull requests

Successful merges:

 - rust-lang#138972 (std: Fix build for NuttX targets)
 - rust-lang#139107 (std: make `cmath` functions safe)
 - rust-lang#139607 (Add regression test for rust-lang#127424)
 - rust-lang#139691 (Document that `opt-dist` requires metrics to be enabled)
 - rust-lang#139707 (Fix comment in bootstrap)
 - rust-lang#139708 (Fix name of field in doc comment)
 - rust-lang#139709 (bootstrap: fix typo in doc string)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 13, 2025
…enton

Rollup of 6 pull requests

Successful merges:

 - rust-lang#139107 (std: make `cmath` functions safe)
 - rust-lang#139607 (Add regression test for rust-lang#127424)
 - rust-lang#139691 (Document that `opt-dist` requires metrics to be enabled)
 - rust-lang#139707 (Fix comment in bootstrap)
 - rust-lang#139708 (Fix name of field in doc comment)
 - rust-lang#139709 (bootstrap: fix typo in doc string)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 546367e into rust-lang:master Apr 13, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 13, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 13, 2025
Rollup merge of rust-lang#139607 - reddevilmidzy:add-regression-test, r=petrochenkov

Add regression test for rust-lang#127424

Fixes: rust-lang#127424

This ICE no longer reproduces, so it appears to have already been fixed.
This PR adds a regression test to ensure the issue doesn’t come back in the future.

Please let me know if there's anything I should improve or revise!
@reddevilmidzy reddevilmidzy deleted the add-regression-test branch April 15, 2025 11:42
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Apr 19, 2025
…enton

Rollup of 6 pull requests

Successful merges:

 - rust-lang#139107 (std: make `cmath` functions safe)
 - rust-lang#139607 (Add regression test for rust-lang#127424)
 - rust-lang#139691 (Document that `opt-dist` requires metrics to be enabled)
 - rust-lang#139707 (Fix comment in bootstrap)
 - rust-lang#139708 (Fix name of field in doc comment)
 - rust-lang#139709 (bootstrap: fix typo in doc string)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: assertion failed: matches!(owner, hir::MaybeOwner::Phantom)
5 participants