Skip to content

Commit c31e68f

Browse files
authored
Rollup merge of rust-lang#150975 - add-test-norm-const-projections-mgca, r=fmease
ui: add test for normalizing const projections with assoc const equality This adds a UI test to associated-const-bindings (created new) directory to ensure that constant projections with associated const equality bounds are correctly normalized. File added: - `tests/ui/const-generics/associated-const-bindings/normalization-via-param-env.rs` r? @fmease r? @camelid Fixes rust-lang#120905
2 parents 565c663 + 8d1d88b commit c31e68f

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//@ check-pass
2+
#![feature(min_generic_const_args)]
3+
#![allow(incomplete_features)]
4+
5+
// Regression test for normalizing const projections
6+
// with associated const equality bounds.
7+
8+
trait Trait {
9+
#[type_const]
10+
const C: usize;
11+
}
12+
13+
fn f<T: Trait<C = 1>>() {
14+
// This must normalize <T as Trait>::C to 1
15+
let _: [(); T::C] = [()];
16+
}
17+
18+
fn main() {}

0 commit comments

Comments
 (0)