diff options
| author | Amjad Alsharafi <amjadsharafi10@gmail.com> | 2020-08-31 18:35:04 +0800 |
|---|---|---|
| committer | Amjad Alsharafi <amjadsharafi10@gmail.com> | 2020-08-31 18:52:22 +0800 |
| commit | 668f63d83302c858dfae998e22fe3881d56d4e52 (patch) | |
| tree | 34cb1a3dd6ac9ed99a3176165ed2a94ee67b4935 /src/test/ui/const-generics/std | |
| parent | 7a7a28d6bbfa6bbbbd3c4d65a11e9b33995cd63f (diff) | |
| download | rust-668f63d83302c858dfae998e22fe3881d56d4e52.tar.gz rust-668f63d83302c858dfae998e22fe3881d56d4e52.zip | |
Fix duplicate error messages in const_generics tests
Diffstat (limited to 'src/test/ui/const-generics/std')
| -rw-r--r-- | src/test/ui/const-generics/std/const-generics-range.min.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/const-generics/std/const-generics-range.rs | 14 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/test/ui/const-generics/std/const-generics-range.min.stderr b/src/test/ui/const-generics/std/const-generics-range.min.stderr index 00edcbc53ce..a71e7442021 100644 --- a/src/test/ui/const-generics/std/const-generics-range.min.stderr +++ b/src/test/ui/const-generics/std/const-generics-range.min.stderr @@ -35,7 +35,7 @@ LL | struct _RangeInclusive<const R: std::ops::RangeInclusive<usize>>; = note: more complex types are supported with `#[feature(const_generics)]` error: `std::ops::RangeTo<usize>` is forbidden as the type of a const generic parameter - --> $DIR/const-generics-range.rs:30:26 + --> $DIR/const-generics-range.rs:29:26 | LL | struct _RangeTo<const R: std::ops::RangeTo<usize>>; | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -44,7 +44,7 @@ LL | struct _RangeTo<const R: std::ops::RangeTo<usize>>; = note: more complex types are supported with `#[feature(const_generics)]` error: `std::ops::RangeToInclusive<usize>` is forbidden as the type of a const generic parameter - --> $DIR/const-generics-range.rs:35:35 + --> $DIR/const-generics-range.rs:34:35 | LL | struct _RangeToInclusive<const R: std::ops::RangeToInclusive<usize>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/const-generics/std/const-generics-range.rs b/src/test/ui/const-generics/std/const-generics-range.rs index 209aa39775d..c04f4a3acfb 100644 --- a/src/test/ui/const-generics/std/const-generics-range.rs +++ b/src/test/ui/const-generics/std/const-generics-range.rs @@ -6,35 +6,33 @@ // `Range` should be usable within const generics: struct _Range<const R: std::ops::Range<usize>>; -//[min]~^ ERROR `std::ops::Range<usize>` is forbidden as the type of a const generic parameter +//[min]~^ ERROR `std::ops::Range<usize>` is forbidden const RANGE : _Range<{ 0 .. 1000 }> = _Range; // `RangeFrom` should be usable within const generics: struct _RangeFrom<const R: std::ops::RangeFrom<usize>>; -//[min]~^ ERROR `std::ops::RangeFrom<usize>` is forbidden as the type of a const generic parameter +//[min]~^ ERROR `std::ops::RangeFrom<usize>` is forbidden const RANGE_FROM : _RangeFrom<{ 0 .. }> = _RangeFrom; // `RangeFull` should be usable within const generics: struct _RangeFull<const R: std::ops::RangeFull>; -//[min]~^ ERROR `std::ops::RangeFull` is forbidden as the type of a const generic parameter +//[min]~^ ERROR `std::ops::RangeFull` is forbidden const RANGE_FULL : _RangeFull<{ .. }> = _RangeFull; // Regression test for #70155 // `RangeInclusive` should be usable within const generics: struct _RangeInclusive<const R: std::ops::RangeInclusive<usize>>; -//[min]~^ ERROR `std::ops::RangeInclusive<usize>` is forbidden as the type of a const generic -// parameter +//[min]~^ ERROR `std::ops::RangeInclusive<usize>` is forbidden const RANGE_INCLUSIVE : _RangeInclusive<{ 0 ..= 999 }> = _RangeInclusive; // `RangeTo` should be usable within const generics: struct _RangeTo<const R: std::ops::RangeTo<usize>>; -//[min]~^ ERROR `std::ops::RangeTo<usize>` is forbidden as the type of a const generic parameter +//[min]~^ ERROR `std::ops::RangeTo<usize>` is forbidden const RANGE_TO : _RangeTo<{ .. 1000 }> = _RangeTo; // `RangeToInclusive` should be usable within const generics: struct _RangeToInclusive<const R: std::ops::RangeToInclusive<usize>>; -//[min]~^ ERROR `std::ops::RangeToInclusive<usize>` is forbidden as the type of a const generic -// parameter +//[min]~^ ERROR `std::ops::RangeToInclusive<usize>` is forbidden const RANGE_TO_INCLUSIVE : _RangeToInclusive<{ ..= 999 }> = _RangeToInclusive; pub fn main() {} |
