Skip to content

Commit

Permalink
Fixed file formatting and made tidy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Amjad50 committed Aug 26, 2020
1 parent d89d2a9 commit 7a7a28d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ impl A for B {}

fn test<const T: &'static dyn A>() {
//[full]~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` to be used
//[min]~^^ ERROR `&'static (dyn A + 'static)` is forbidden as the type of a const generic parameter
//[min]~^^ ERROR `&'static (dyn A + 'static)` is forbidden as the type of
// a const generic parameter
//[min]~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` to be used
unimplemented!()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:29:26
--> $DIR/const-generics-range.rs:30:26
|
LL | struct _RangeTo<const R: std::ops::RangeTo<usize>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -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:34:35
--> $DIR/const-generics-range.rs:35:35
|
LL | struct _RangeToInclusive<const R: std::ops::RangeToInclusive<usize>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
6 changes: 4 additions & 2 deletions src/test/ui/const-generics/std/const-generics-range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ 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 as the type of a const generic
// parameter
const RANGE_INCLUSIVE : _RangeInclusive<{ 0 ..= 999 }> = _RangeInclusive;

// `RangeTo` should be usable within const generics:
Expand All @@ -32,7 +33,8 @@ 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 as the type of a const generic
// parameter
const RANGE_TO_INCLUSIVE : _RangeToInclusive<{ ..= 999 }> = _RangeToInclusive;

pub fn main() {}

0 comments on commit 7a7a28d

Please sign in to comment.