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.
This commit is contained in:
CDirkx 2020-03-22 22:04:05 +01:00
parent 98803c182b
commit bd1df44057

View File

@ -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 R: std::ops::RangeInclusive<usize>>;
const C : S<{ 0 ..= 999 }> = S;
pub fn main() {}