Skip to content

Commit bd1df44

Browse files
author
CDirkx
committed
Add regression test for rust-lang#70155.
With rust-lang#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 rust-lang#70155. A test is added to avoid a change to the private fields or the equality implementation of the range from subtly reverting rust-lang#70155.
1 parent 98803c1 commit bd1df44

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// check-pass
2+
#![allow(incomplete_features)]
3+
#![feature(const_generics)]
4+
5+
// Regression test for #70155:
6+
// `RangeInclusive` should be usable with const generics
7+
8+
struct S<const R: std::ops::RangeInclusive<usize>>;
9+
10+
const C : S<{ 0 ..= 999 }> = S;
11+
12+
pub fn main() {}

0 commit comments

Comments
 (0)