From bd1df4405785a34ac494007f185744d51ddd9138 Mon Sep 17 00:00:00 2001 From: CDirkx Date: Sun, 22 Mar 2020 22:04:05 +0100 Subject: [PATCH] Add regression test for #70155. With #70166 merged, `RangeInclusive` now derives `PartialEq` and `Eq`, implementing structural equality and as a side effect the range is now usable with const generics, closing #70155. A test is added to avoid a change to the private fields or the equality implementation of the range from subtly reverting #70155. --- src/test/ui/const-generics/issues/issue-70155.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/test/ui/const-generics/issues/issue-70155.rs diff --git a/src/test/ui/const-generics/issues/issue-70155.rs b/src/test/ui/const-generics/issues/issue-70155.rs new file mode 100644 index 00000000000..be71b347590 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-70155.rs @@ -0,0 +1,12 @@ +// check-pass +#![allow(incomplete_features)] +#![feature(const_generics)] + +// Regression test for #70155: +// `RangeInclusive` should be usable with const generics + +struct S>; + +const C : S<{ 0 ..= 999 }> = S; + +pub fn main() {}