add testcase for 87076

using
https://github.com/rust-lang/rust/issues/87076#issuecomment-878090143 as
testcase
This commit is contained in:
Marcel Hellwig 2021-07-19 07:24:07 +02:00
parent 10c0b003db
commit 7df032738c

View file

@ -0,0 +1,20 @@
// build-pass
#![feature(const_generics)]
#![allow(incomplete_features)]
#[derive(PartialEq, Eq)]
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();
}