Skip to content

Commit

Permalink
Add regression test for rust-lang#70155.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
CDirkx committed Mar 22, 2020
1 parent 98803c1 commit bd1df44
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/ui/const-generics/issues/issue-70155.rs
Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit bd1df44

Please sign in to comment.