2021-07-19 00:24:07 -05:00
|
|
|
// build-pass
|
|
|
|
|
2021-08-30 03:59:53 -05:00
|
|
|
#![feature(adt_const_params)]
|
2021-07-19 00:24:07 -05:00
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
2023-05-16 23:05:46 -05:00
|
|
|
use std::marker::ConstParamTy;
|
|
|
|
|
|
|
|
#[derive(PartialEq, Eq, ConstParamTy)]
|
2021-07-19 00:24:07 -05:00
|
|
|
pub struct UnitDims {
|
|
|
|
pub time: u8,
|
|
|
|
pub length: u8,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct UnitValue<const DIMS: UnitDims>;
|
|
|
|
|
|
|
|
impl<const DIMS: UnitDims> UnitValue<DIMS> {
|
|
|
|
fn crash() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
UnitValue::<{ UnitDims { time: 1, length: 2 } }>::crash();
|
|
|
|
}
|