Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
A reduced version: Tested in using
The other ICE block is also standalone
for the first example: ` Regression in :thinking: EDIT: same for the second snippet.
This is caused by Seems as if this issue takes care of FIXME ^^. Not sure what the right solution is, we originally tried to skip reborrows because implicit autorefs/autoderefs lead to confusing error messages given that we don't support derefs and refs in abstract consts. Maybe the right solution is to just clarify that autorefs/autoderefs happen there. Thoughts
No longer ICEs since (perhaps due to ?)

Discussion:
<ins> // check-pass #![feature(adt_const_params, generic_const_exprs)] //~^ WARN the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features] //~^^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features] pub struct Changes<const CHANGES: &'static [&'static str]> where [(); CHANGES.len()]:, { changes: [usize; CHANGES.len()], } impl<const CHANGES: &'static [&'static str]> Changes<CHANGES> where [(); CHANGES.len()]:, { pub const fn new() -> Self { Self { changes: [0; CHANGES.len()], } } } pub fn main() {} </ins>

<ins> warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/issue-97047-ice-1.rs:3:12 | LL | #![feature(adt_const_params, generic_const_exprs)] |            ^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default = note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/issue-97047-ice-1.rs:3:30 | LL | #![feature(adt_const_params, generic_const_exprs)] |                              ^^^^^^^^^^^^^^^^^^^ | = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information warning: 2 warnings emitted </ins>

<ins> // check-pass #![feature(adt_const_params, generic_const_exprs)] //~^ WARN the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features] //~^^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features] pub struct Changes<const CHANGES: &'static [&'static str]> where [(); CHANGES.len()]:, { changes: [usize; CHANGES.len()], } impl<const CHANGES: &'static [&'static str]> Changes<CHANGES> where [(); CHANGES.len()]:, { pub fn combine(&mut self, other: &Self) { for _change in &self.changes {} } } pub fn main() {} </ins>

<ins> warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/issue-97047-ice-2.rs:3:12 | LL | #![feature(adt_const_params, generic_const_exprs)] |            ^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default = note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/issue-97047-ice-2.rs:3:30 | LL | #![feature(adt_const_params, generic_const_exprs)] |                              ^^^^^^^^^^^^^^^^^^^ | = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information warning: 2 warnings emitted </ins>