From 7df032738c9d9b9f5a9ea30aa66138e8548d4a3a Mon Sep 17 00:00:00 2001 From: Marcel Hellwig Date: Mon, 19 Jul 2021 07:24:07 +0200 Subject: [PATCH] add testcase for 87076 using https://github.com/rust-lang/rust/issues/87076#issuecomment-878090143 as testcase --- .../ui/const-generics/issues/issue-87076.rs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/ui/const-generics/issues/issue-87076.rs diff --git a/src/test/ui/const-generics/issues/issue-87076.rs b/src/test/ui/const-generics/issues/issue-87076.rs new file mode 100644 index 0000000000000..5dfda943bf69c --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-87076.rs @@ -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; + +impl UnitValue { + fn crash() {} +} + +fn main() { + UnitValue::<{ UnitDims { time: 1, length: 2 } }>::crash(); +}