Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions tests/ui/const-generics/mgca/type-const-ctor-148953.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/148953>
//!
//! Unit struct constructors used as the RHS of a `type const` associated
//! const used to ICE during normalization because they were lowered as
//! `Const::new_unevaluated` with a Ctor def_id. Fixed by adding proper const
//! constructor support that produces a concrete ValTree value instead.
//@ check-pass

#![feature(min_generic_const_args, adt_const_params)]
#![expect(incomplete_features)]

use std::marker::ConstParamTy;

#[derive(ConstParamTy, PartialEq, Eq)]
struct S;

impl S {
type const N: S = S;
}

#[derive(ConstParamTy, PartialEq, Eq)]
enum E {
V,
}

impl E {
type const M: E = { E::V };
}

fn main() {}
Loading