|
6 | 6 |
|
7 | 7 | // `Range` should be usable within const generics:
|
8 | 8 | struct _Range<const R: std::ops::Range<usize>>;
|
9 |
| -//[min]~^ ERROR `std::ops::Range<usize>` is forbidden as the type of a const generic parameter |
| 9 | +//[min]~^ ERROR `std::ops::Range<usize>` is forbidden |
10 | 10 | const RANGE : _Range<{ 0 .. 1000 }> = _Range;
|
11 | 11 |
|
12 | 12 | // `RangeFrom` should be usable within const generics:
|
13 | 13 | struct _RangeFrom<const R: std::ops::RangeFrom<usize>>;
|
14 |
| -//[min]~^ ERROR `std::ops::RangeFrom<usize>` is forbidden as the type of a const generic parameter |
| 14 | +//[min]~^ ERROR `std::ops::RangeFrom<usize>` is forbidden |
15 | 15 | const RANGE_FROM : _RangeFrom<{ 0 .. }> = _RangeFrom;
|
16 | 16 |
|
17 | 17 | // `RangeFull` should be usable within const generics:
|
18 | 18 | struct _RangeFull<const R: std::ops::RangeFull>;
|
19 |
| -//[min]~^ ERROR `std::ops::RangeFull` is forbidden as the type of a const generic parameter |
| 19 | +//[min]~^ ERROR `std::ops::RangeFull` is forbidden |
20 | 20 | const RANGE_FULL : _RangeFull<{ .. }> = _RangeFull;
|
21 | 21 |
|
22 | 22 | // Regression test for #70155
|
23 | 23 | // `RangeInclusive` should be usable within const generics:
|
24 | 24 | struct _RangeInclusive<const R: std::ops::RangeInclusive<usize>>;
|
25 |
| -//[min]~^ ERROR `std::ops::RangeInclusive<usize>` is forbidden as the type of a const generic |
26 |
| -// parameter |
| 25 | +//[min]~^ ERROR `std::ops::RangeInclusive<usize>` is forbidden |
27 | 26 | const RANGE_INCLUSIVE : _RangeInclusive<{ 0 ..= 999 }> = _RangeInclusive;
|
28 | 27 |
|
29 | 28 | // `RangeTo` should be usable within const generics:
|
30 | 29 | struct _RangeTo<const R: std::ops::RangeTo<usize>>;
|
31 |
| -//[min]~^ ERROR `std::ops::RangeTo<usize>` is forbidden as the type of a const generic parameter |
| 30 | +//[min]~^ ERROR `std::ops::RangeTo<usize>` is forbidden |
32 | 31 | const RANGE_TO : _RangeTo<{ .. 1000 }> = _RangeTo;
|
33 | 32 |
|
34 | 33 | // `RangeToInclusive` should be usable within const generics:
|
35 | 34 | struct _RangeToInclusive<const R: std::ops::RangeToInclusive<usize>>;
|
36 |
| -//[min]~^ ERROR `std::ops::RangeToInclusive<usize>` is forbidden as the type of a const generic |
37 |
| -// parameter |
| 35 | +//[min]~^ ERROR `std::ops::RangeToInclusive<usize>` is forbidden |
38 | 36 | const RANGE_TO_INCLUSIVE : _RangeToInclusive<{ ..= 999 }> = _RangeToInclusive;
|
39 | 37 |
|
40 | 38 | pub fn main() {}
|
0 commit comments