1
Fork 0

Fixed file formatting and made tidy happy

This commit is contained in:
Amjad Alsharafi 2020-08-26 19:17:07 +08:00
parent d89d2a972d
commit 7a7a28d6bb
3 changed files with 8 additions and 5 deletions

View file

@ -9,7 +9,8 @@ impl A for B {}
fn test<const T: &'static dyn A>() { fn test<const T: &'static dyn A>() {
//[full]~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` to be used //[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 //[min]~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` to be used
unimplemented!() unimplemented!()
} }

View file

@ -35,7 +35,7 @@ LL | struct _RangeInclusive<const R: std::ops::RangeInclusive<usize>>;
= note: more complex types are supported with `#[feature(const_generics)]` = 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 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>>; 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)]` = 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 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>>; LL | struct _RangeToInclusive<const R: std::ops::RangeToInclusive<usize>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -22,7 +22,8 @@ const RANGE_FULL : _RangeFull<{ .. }> = _RangeFull;
// Regression test for #70155 // Regression test for #70155
// `RangeInclusive` should be usable within const generics: // `RangeInclusive` should be usable within const generics:
struct _RangeInclusive<const R: std::ops::RangeInclusive<usize>>; 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; const RANGE_INCLUSIVE : _RangeInclusive<{ 0 ..= 999 }> = _RangeInclusive;
// `RangeTo` should be usable within const generics: // `RangeTo` should be usable within const generics:
@ -32,7 +33,8 @@ const RANGE_TO : _RangeTo<{ .. 1000 }> = _RangeTo;
// `RangeToInclusive` should be usable within const generics: // `RangeToInclusive` should be usable within const generics:
struct _RangeToInclusive<const R: std::ops::RangeToInclusive<usize>>; 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; const RANGE_TO_INCLUSIVE : _RangeToInclusive<{ ..= 999 }> = _RangeToInclusive;
pub fn main() {} pub fn main() {}