blob: a32c1f965f8b59409e80a4b923c86eee2d4c59cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  | 
// build-pass
#![feature(adt_const_params)]
#![allow(incomplete_features)]
use std::marker::ConstParamTy;
#[derive(PartialEq, Eq, ConstParamTy)]
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();
}
 
  |