File tree 3 files changed +8
-5
lines changed
src/test/ui/const-generics
3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ impl A for B {}
9
9
10
10
fn test < const T : & ' static dyn A > ( ) {
11
11
//[full]~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` to be used
12
- //[min]~^^ ERROR `&'static (dyn A + 'static)` is forbidden as the type of a const generic parameter
12
+ //[min]~^^ ERROR `&'static (dyn A + 'static)` is forbidden as the type of
13
+ // a const generic parameter
13
14
//[min]~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` to be used
14
15
unimplemented ! ( )
15
16
}
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ LL | struct _RangeInclusive<const R: std::ops::RangeInclusive<usize>>;
35
35
= note: more complex types are supported with `#[feature(const_generics)]`
36
36
37
37
error: `std::ops::RangeTo<usize>` is forbidden as the type of a const generic parameter
38
- --> $DIR/const-generics-range.rs:29 :26
38
+ --> $DIR/const-generics-range.rs:30 :26
39
39
|
40
40
LL | struct _RangeTo<const R: std::ops::RangeTo<usize>>;
41
41
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -44,7 +44,7 @@ LL | struct _RangeTo<const R: std::ops::RangeTo<usize>>;
44
44
= note: more complex types are supported with `#[feature(const_generics)]`
45
45
46
46
error: `std::ops::RangeToInclusive<usize>` is forbidden as the type of a const generic parameter
47
- --> $DIR/const-generics-range.rs:34 :35
47
+ --> $DIR/const-generics-range.rs:35 :35
48
48
|
49
49
LL | struct _RangeToInclusive<const R: std::ops::RangeToInclusive<usize>>;
50
50
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ const RANGE_FULL : _RangeFull<{ .. }> = _RangeFull;
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 parameter
25
+ //[min]~^ ERROR `std::ops::RangeInclusive<usize>` is forbidden as the type of a const generic
26
+ // parameter
26
27
const RANGE_INCLUSIVE : _RangeInclusive < { 0 ..= 999 } > = _RangeInclusive;
27
28
28
29
// `RangeTo` should be usable within const generics:
@@ -32,7 +33,8 @@ const RANGE_TO : _RangeTo<{ .. 1000 }> = _RangeTo;
32
33
33
34
// `RangeToInclusive` should be usable within const generics:
34
35
struct _RangeToInclusive < const R : std:: ops:: RangeToInclusive < usize > > ;
35
- //[min]~^ ERROR `std::ops::RangeToInclusive<usize>` is forbidden as the type of a const generic parameter
36
+ //[min]~^ ERROR `std::ops::RangeToInclusive<usize>` is forbidden as the type of a const generic
37
+ // parameter
36
38
const RANGE_TO_INCLUSIVE : _RangeToInclusive < { ..= 999 } > = _RangeToInclusive;
37
39
38
40
pub fn main ( ) { }
You can’t perform that action at this time.
0 commit comments