From 7c10734455ee9fd1cb197f3986687d37f0ef609f Mon Sep 17 00:00:00 2001 From: malezjaa Date: Wed, 16 Sep 2026 00:20:01 +0200 Subject: [PATCH 1/2] regression test for inherent associated const ICE --- .../ice-normalize-inherent-assoc-const.rs | 19 +++++++++++++++++++ .../ice-normalize-inherent-assoc-const.stderr | 15 +++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 tests/ui/associated-inherent-types/ice-normalize-inherent-assoc-const.rs create mode 100644 tests/ui/associated-inherent-types/ice-normalize-inherent-assoc-const.stderr diff --git a/tests/ui/associated-inherent-types/ice-normalize-inherent-assoc-const.rs b/tests/ui/associated-inherent-types/ice-normalize-inherent-assoc-const.rs new file mode 100644 index 0000000000000..843e33bae0d81 --- /dev/null +++ b/tests/ui/associated-inherent-types/ice-normalize-inherent-assoc-const.rs @@ -0,0 +1,19 @@ +//! Regression test for: https://github.com/rust-lang/rust/issues/142722. + +#![feature(trivial_bounds)] +#![feature(generic_const_exprs)] +#![feature(min_generic_const_args)] +#![feature(inherent_associated_types)] + +struct Foo; +impl Foo { + const ASSOC_C: usize = todo!(); + //~^ ERROR evaluation panicked: not yet implemented + fn foo() + where + [u8; Self::ASSOC_C]:, + { + } +} + +pub fn main() {} diff --git a/tests/ui/associated-inherent-types/ice-normalize-inherent-assoc-const.stderr b/tests/ui/associated-inherent-types/ice-normalize-inherent-assoc-const.stderr new file mode 100644 index 0000000000000..5ce8a67bc7810 --- /dev/null +++ b/tests/ui/associated-inherent-types/ice-normalize-inherent-assoc-const.stderr @@ -0,0 +1,15 @@ +error[E0080]: evaluation panicked: not yet implemented + --> $DIR/ice-normalize-inherent-assoc-const.rs:10:28 + | +LL | const ASSOC_C: usize = todo!(); + | ^^^^^^^ evaluation of `Foo::ASSOC_C` failed here + +note: erroneous constant encountered + --> $DIR/ice-normalize-inherent-assoc-const.rs:14:14 + | +LL | [u8; Self::ASSOC_C]:, + | ^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. From 01594298297ece4e1f671722da02ed8c0e445eef Mon Sep 17 00:00:00 2001 From: malezjaa Date: Mon, 28 Sep 2026 00:03:56 +0200 Subject: [PATCH 2/2] update feature name --- .../ice-normalize-inherent-assoc-const.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ui/associated-inherent-types/ice-normalize-inherent-assoc-const.rs b/tests/ui/associated-inherent-types/ice-normalize-inherent-assoc-const.rs index 843e33bae0d81..a7b430f85a9a2 100644 --- a/tests/ui/associated-inherent-types/ice-normalize-inherent-assoc-const.rs +++ b/tests/ui/associated-inherent-types/ice-normalize-inherent-assoc-const.rs @@ -2,7 +2,7 @@ #![feature(trivial_bounds)] #![feature(generic_const_exprs)] -#![feature(min_generic_const_args)] +#![feature(gca_min_const_items)] #![feature(inherent_associated_types)] struct Foo;