Skip to content

Commit

Permalink
add testcase for 87076
Browse files Browse the repository at this point in the history
using
rust-lang#87076 (comment) as
testcase
  • Loading branch information
hellow554 committed Jul 19, 2021
1 parent 10c0b00 commit 7df0327
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/ui/const-generics/issues/issue-87076.rs
Original file line number Diff line number Diff line change
@@ -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();
}

0 comments on commit 7df0327

Please sign in to comment.