Skip to content

Commit 5afb1ea

Browse files
Rollup merge of rust-lang#152436 - fmease:reenable-gci-test-case, r=mati865
Reenable a GCI+mGCA+GCPT test case The GCI+mGCA+GCPT test case can now be made to work with the necessary features and tweaks.
2 parents 860e959 + 32e49a8 commit 5afb1ea

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

tests/ui/generic-const-items/assoc-const-bindings.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
11
//@ check-pass
22

33
#![feature(generic_const_items, min_generic_const_args)]
4-
#![feature(adt_const_params)]
5-
#![allow(incomplete_features)]
4+
#![feature(adt_const_params, unsized_const_params, generic_const_parameter_types)]
5+
#![expect(incomplete_features)]
6+
7+
use std::marker::{ConstParamTy, ConstParamTy_};
68

79
trait Owner {
810
type const C<const N: u32>: u32;
911
type const K<const N: u32>: u32;
10-
// #[type_const]
11-
// const Q<T>: Maybe<T>;
12+
type const Q<T: ConstParamTy_>: Maybe<T>;
1213
}
1314

1415
impl Owner for () {
1516
type const C<const N: u32>: u32 = N;
1617
type const K<const N: u32>: u32 = const { 99 + 1 };
17-
// FIXME(mgca): re-enable once we properly support ctors and generics on paths
18-
// #[type_const]
19-
// const Q<T>: Maybe<T> = Maybe::Nothing;
18+
type const Q<T: ConstParamTy_>: Maybe<T> = Maybe::Nothing::<T>;
2019
}
2120

2221
fn take0<const N: u32>(_: impl Owner<C<N> = { N }>) {}
2322
fn take1(_: impl Owner<K<99> = 100>) {}
24-
// FIXME(mgca): re-enable once we properly support ctors and generics on paths
25-
// fn take2(_: impl Owner<Q<()> = { Maybe::Just(()) }>) {}
23+
fn take2(_: impl Owner<Q<()> = { Maybe::Just::<()>(()) }>) {}
2624

2725
fn main() {
2826
take0::<128>(());
2927
take1(());
3028
}
3129

32-
#[derive(PartialEq, Eq, std::marker::ConstParamTy)]
30+
#[derive(PartialEq, Eq, ConstParamTy)]
3331
enum Maybe<T> {
3432
Nothing,
3533
Just(T),

0 commit comments

Comments
 (0)