From 913c89b48a8f69d24e548ea969d7d426a1e36abd Mon Sep 17 00:00:00 2001 From: zakrad <49591476+zakrad@users.noreply.github.com> Date: Sun, 8 Nov 2026 19:23:33 +0330 Subject: [PATCH] Add regression test for GCA associated const with a pattern type field --- .../assoc-const-pattern-type-field-162336.rs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/ui/const-generics/gca/assoc-const-pattern-type-field-162336.rs diff --git a/tests/ui/const-generics/gca/assoc-const-pattern-type-field-162336.rs b/tests/ui/const-generics/gca/assoc-const-pattern-type-field-162336.rs new file mode 100644 index 0000000000000..c4a7bdbd1ca52 --- /dev/null +++ b/tests/ui/const-generics/gca/assoc-const-pattern-type-field-162336.rs @@ -0,0 +1,27 @@ +//! Regression test for . +//@ build-pass +//@ compile-flags: -Znext-solver + +#![feature(gca_min_const_items, gca_const_items)] +#![expect(incomplete_features)] + +use std::time::Duration; + +trait Trait { + const CONST: Duration; +} + +struct Thing; + +impl Trait for Thing { + const CONST: Duration = Duration::ZERO; +} + +fn generic() -> Duration { + T::CONST +} + +fn main() { + let _ = ::CONST; + let _ = generic::(); +}