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::(); +}