Change:
<!-- [31mICE[0m: Rustc '-Zunstable-options --edition=2024 -ooutputfile -Zdump-mir-dir=dir' 'error: internal compiler error: inconsistent resolution for an import', 'error: internal compiler error: inconsistent resolution for an import' File: --auto-reduced (treereduce-rust): original: Version information ` Command: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongProgram output</strong</summary<p</p</details<!-- query stack: [resolverforlowering_raw] getting the resolver for lowering --
also crashes with just
Regression in nightly-2023-07-01 commit[0] 2023-06-29: Auto merge of - spastorino:new-rpitit-21, r=compiler-errors commit[1] 2023-06-30: Auto merge of - nnethercote:codegen-opts, r=oli-obk commit[2] 2023-06-30: Auto merge of - matthiaskrgr:rollup-fct3wj7, r=matthiaskrgr commit[3] 2023-06-30: Auto merge of - matthiaskrgr:rollup-j3abaks, r=matthiaskrgr commit[4] 2023-06-30: Auto merge of - agausmann:avr-object-file, r=nagisa commit[5] 2023-06-30: Auto merge of - bzEq:aix-embed-llvmbc, r=nagisa commit[6] 2023-06-30: Auto merge of - ferrocene:pa-fix-mir-opt-bless, r=oli-obk I suspect this is
slightly more minimal (ordering is irrelevant)
more reduced:
Again, the original example still crashes.

Discussion:
let Some(module) = single_import.imported_module.get() else { return Err((Undetermined, Weak::No)); }; <del> let ImportKind::Single { source: ident, source_bindings, .. } = &single_import.kind </del> <ins> let ImportKind::Single { source: ident, target, target_bindings, .. } = &single_import.kind </ins> else { unreachable!(); }; <del> if binding.map_or(false, |binding| binding.module().is_some()) && source_bindings.iter().all(|binding| matches!(binding.get(), Err(Undetermined))) { // This branch allows the binding to be defined or updated later, </del> <ins> if (ident != target) && target_bindings.iter().all(|binding| binding.get().is_none()) { // This branch allows the binding to be defined or updated later if the target name // can hide the source but these bindings are not obtained. </ins> // avoiding module inconsistency between the resolve process and the finalize process. // See more details in #124840 return Err((Undetermined, Weak::No));

<ins> //@ edition: 2018 // https://github.com/rust-lang/rust/issues/124490 use ops::{self as std}; //~^ ERROR: unresolved import `ops` use std::collections::{self as ops}; fn main() {} </ins>

<ins> error[E0432]: unresolved import `ops` --> $DIR/cycle-import-in-std-1.rs:5:11 | LL | use ops::{self as std}; |           ^^^^^^^^^^^ no external crate `ops` | = help: consider importing one of these items instead: core::ops std::ops error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0432`. </ins>

<ins> //@ edition: 2018 // https://github.com/rust-lang/rust/issues/125013 use ops::{self as std}; //~^ ERROR: unresolved import `ops` use std::ops::Deref::{self as ops}; fn main() {} </ins>

<ins> error[E0432]: unresolved import `ops` --> $DIR/cycle-import-in-std-2.rs:5:11 | LL | use ops::{self as std}; |           ^^^^^^^^^^^ no external crate `ops` | = help: consider importing one of these items instead: core::ops std::ops error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0432`. </ins>