Skip to content

Commit

Permalink
Bless expected errors
Browse files Browse the repository at this point in the history
  • Loading branch information
eopb committed Oct 12, 2020
1 parent facb38d commit 79351b1
Show file tree
Hide file tree
Showing 54 changed files with 132 additions and 132 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/array-size-in-generic-struct-param.rs:9:48
|
LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments `N`
= help: const parameters may only be used as standalone arguments, i.e. `N`

error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/array-size-in-generic-struct-param.rs:20:15
|
LL | arr: [u8; CFG.arr_size],
| ^^^ cannot perform const operation using `CFG`
|
= help: const parameters may only be used as standalone arguments `CFG`
= help: const parameters may only be used as standalone arguments, i.e. `CFG`

error: `Config` is forbidden as the type of a const generic parameter
--> $DIR/array-size-in-generic-struct-param.rs:18:21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#[allow(dead_code)]
struct ArithArrayLen<const N: usize>([u32; 0 + N]);
//[full]~^ ERROR constant expression depends on a generic parameter
//[min]~^^ ERROR generic parameters must not be used inside const evaluations
//[min]~^^ ERROR generic parameters may not be used in const operations

#[derive(PartialEq, Eq)]
struct Config {
Expand All @@ -19,7 +19,7 @@ struct B<const CFG: Config> {
//[min]~^ ERROR `Config` is forbidden
arr: [u8; CFG.arr_size],
//[full]~^ ERROR constant expression depends on a generic parameter
//[min]~^^ ERROR generic parameters must not be used inside const evaluations
//[min]~^^ ERROR generic parameters may not be used in const operations
}

const C: Config = Config { arr_size: 5 };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/const-argument-if-length.rs:19:24
|
LL | pad: [u8; is_zst::<T>()],
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in anonymous constants
= note: type parameters may not be used in const expressions

error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/const-argument-if-length.rs:17:12
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/const-generics/const-argument-if-length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct AtLeastByte<T: ?Sized> {
value: T,
//~^ ERROR the size for values of type `T` cannot be known at compilation time
pad: [u8; is_zst::<T>()],
//[min]~^ ERROR generic parameters must not be used inside const evaluations
//[min]~^ ERROR generic parameters may not be used in const operations
//[full]~^^ ERROR evaluation of constant value failed
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/feature-gate-const_evaluatable_checked.rs:6:33
|
LL | type Arr<const N: usize> = [u8; N - 1];
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments `N`
= help: const parameters may only be used as standalone arguments, i.e. `N`

error: aborting due to previous error

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#![cfg_attr(min, feature(min_const_generics))]

type Arr<const N: usize> = [u8; N - 1];
//[min]~^ ERROR generic parameters must not be used inside const evaluations
//[min]~^ ERROR generic parameters may not be used in const operations

fn test<const N: usize>() -> Arr<N> where Arr<N>: Default {
//[full]~^ ERROR constant expression depends
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/simple.rs:8:53
|
LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default {
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments `N`
= help: const parameters may only be used as standalone arguments, i.e. `N`

error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/simple.rs:8:35
|
LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default {
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments `N`
= help: const parameters may only be used as standalone arguments, i.e. `N`

error: aborting due to 2 previous errors

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/simple_fail.rs:7:33
|
LL | type Arr<const N: usize> = [u8; N - 1];
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments `N`
= help: const parameters may only be used as standalone arguments, i.e. `N`

error: aborting due to previous error

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#![allow(incomplete_features)]

type Arr<const N: usize> = [u8; N - 1]; //[full]~ ERROR evaluation of constant
//[min]~^ ERROR generic parameters must not be used inside const evaluations
//[min]~^ ERROR generic parameters may not be used in const operations

fn test<const N: usize>() -> Arr<N> where Arr<N>: Sized {
todo!()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/generic-function-call-in-array-length.rs:9:39
|
LL | fn bar<const N: usize>() -> [u32; foo(N)] {
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments `N`
= help: const parameters may only be used as standalone arguments, i.e. `N`

error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/generic-function-call-in-array-length.rs:12:13
|
LL | [0; foo(N)]
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments `N`
= help: const parameters may only be used as standalone arguments, i.e. `N`

error: aborting due to 2 previous errors

Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
const fn foo(n: usize) -> usize { n * 2 }

fn bar<const N: usize>() -> [u32; foo(N)] {
//[min]~^ ERROR generic parameters must not be used inside const evaluations
//[min]~^ ERROR generic parameters may not be used in const operations
//[full]~^^ ERROR constant expression depends on a generic parameter
[0; foo(N)]
//[min]~^ ERROR generic parameters must not be used inside const evaluations
//[min]~^ ERROR generic parameters may not be used in const operations
}

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/generic-sum-in-array-length.rs:7:53
|
LL | fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {}
| ^ cannot perform const operation using `A`
|
= help: const parameters may only be used as standalone arguments `A`
= help: const parameters may only be used as standalone arguments, i.e. `A`

error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/generic-sum-in-array-length.rs:7:57
|
LL | fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {}
| ^ cannot perform const operation using `B`
|
= help: const parameters may only be used as standalone arguments `B`
= help: const parameters may only be used as standalone arguments, i.e. `B`

error: aborting due to 2 previous errors

4 changes: 2 additions & 2 deletions src/test/ui/const-generics/generic-sum-in-array-length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#![cfg_attr(min, feature(min_const_generics))]

fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {}
//[min]~^ ERROR generic parameters must not be used inside const evaluations
//[min]~| ERROR generic parameters must not be used inside const evaluations
//[min]~^ ERROR generic parameters may not be used in const operations
//[min]~| ERROR generic parameters may not be used in const operations
//[full]~^^^ ERROR constant expression depends on a generic parameter

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/intrinsics-type_name-as-const-argument.rs:15:44
|
LL | T: Trait<{std::intrinsics::type_name::<T>()}>
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in anonymous constants
= note: type parameters may not be used in const expressions

error: `&'static str` is forbidden as the type of a const generic parameter
--> $DIR/intrinsics-type_name-as-const-argument.rs:10:22
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trait Trait<const S: &'static str> {}
struct Bug<T>
where
T: Trait<{std::intrinsics::type_name::<T>()}>
//[min]~^ ERROR generic parameters must not be used inside const evaluations
//[min]~^ ERROR generic parameters may not be used in const operations
//[full]~^^ ERROR constant expression depends on a generic parameter
{
t: T
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/issue-61522-array-len-succ.rs:7:45
|
LL | pub struct MyArray<const COUNT: usize>([u8; COUNT + 1]);
| ^^^^^ cannot perform const operation using `COUNT`
|
= help: const parameters may only be used as standalone arguments `COUNT`
= help: const parameters may only be used as standalone arguments, i.e. `COUNT`

error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/issue-61522-array-len-succ.rs:12:30
|
LL | fn inner(&self) -> &[u8; COUNT + 1] {
| ^^^^^ cannot perform const operation using `COUNT`
|
= help: const parameters may only be used as standalone arguments `COUNT`
= help: const parameters may only be used as standalone arguments, i.e. `COUNT`

error: aborting due to 2 previous errors

4 changes: 2 additions & 2 deletions src/test/ui/const-generics/issue-61522-array-len-succ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

pub struct MyArray<const COUNT: usize>([u8; COUNT + 1]);
//[full]~^ ERROR constant expression depends on a generic parameter
//[min]~^^ ERROR generic parameters must not be used
//[min]~^^ ERROR generic parameters may not be used

impl<const COUNT: usize> MyArray<COUNT> {
fn inner(&self) -> &[u8; COUNT + 1] {
//[full]~^ ERROR constant expression depends on a generic parameter
//[min]~^^ ERROR generic parameters must not be used
//[min]~^^ ERROR generic parameters may not be used
&self.0
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/const-generics/issue-67375.min.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/issue-67375.rs:9:25
|
LL | inner: [(); { [|_: &T| {}; 0].len() }],
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in anonymous constants
= note: type parameters may not be used in const expressions

error[E0392]: parameter `T` is never used
--> $DIR/issue-67375.rs:7:12
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/const-generics/issue-67375.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
struct Bug<T> {
//~^ ERROR parameter `T` is never used
inner: [(); { [|_: &T| {}; 0].len() }],
//[min]~^ ERROR generic parameters must not be used inside const evaluations
//[min]~^ ERROR generic parameters may not be used in const operations
//[full]~^^ WARN cannot use constants which depend on generic parameters in types
//[full]~^^^ WARN this was previously accepted by the compiler
}
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/const-generics/issue-67945-1.min.stderr
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/issue-67945-1.rs:14:16
|
LL | let x: S = MaybeUninit::uninit();
| ^ cannot perform const operation using `S`
|
= note: type parameters may not be used in anonymous constants
= note: type parameters may not be used in const expressions

error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/issue-67945-1.rs:17:45
|
LL | let b = &*(&x as *const _ as *const S);
| ^ cannot perform const operation using `S`
|
= note: type parameters may not be used in anonymous constants
= note: type parameters may not be used in const expressions

error[E0392]: parameter `S` is never used
--> $DIR/issue-67945-1.rs:11:12
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/const-generics/issue-67945-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ struct Bug<S> {
//~^ ERROR parameter `S` is never used
A: [(); {
let x: S = MaybeUninit::uninit();
//[min]~^ ERROR generic parameters must not be used inside const evaluations
//[min]~^ ERROR generic parameters may not be used in const operations
//[full]~^^ ERROR mismatched types
let b = &*(&x as *const _ as *const S);
//[min]~^ ERROR generic parameters must not be used inside const evaluations
//[min]~^ ERROR generic parameters may not be used in const operations
0
}],
}
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/const-generics/issue-67945-2.min.stderr
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/issue-67945-2.rs:12:16
|
LL | let x: S = MaybeUninit::uninit();
| ^ cannot perform const operation using `S`
|
= note: type parameters may not be used in anonymous constants
= note: type parameters may not be used in const expressions

error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/issue-67945-2.rs:15:45
|
LL | let b = &*(&x as *const _ as *const S);
| ^ cannot perform const operation using `S`
|
= note: type parameters may not be used in anonymous constants
= note: type parameters may not be used in const expressions

error[E0392]: parameter `S` is never used
--> $DIR/issue-67945-2.rs:9:12
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/const-generics/issue-67945-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ struct Bug<S> {
//~^ ERROR parameter `S` is never used
A: [(); {
let x: S = MaybeUninit::uninit();
//[min]~^ ERROR generic parameters must not be used inside const evaluations
//[min]~^ ERROR generic parameters may not be used in const operations
//[full]~^^ ERROR mismatched types
let b = &*(&x as *const _ as *const S);
//[min]~^ ERROR generic parameters must not be used inside const evaluations
//[min]~^ ERROR generic parameters may not be used in const operations
0
}],
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/const-generics/issues/issue-61747.min.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/issue-61747.rs:8:30
|
LL | fn successor() -> Const<{C + 1}> {
| ^ cannot perform const operation using `C`
|
= help: const parameters may only be used as standalone arguments `C`
= help: const parameters may only be used as standalone arguments, i.e. `C`

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/const-generics/issues/issue-61747.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ struct Const<const N: usize>;
impl<const C: usize> Const<{C}> {
fn successor() -> Const<{C + 1}> {
//[full]~^ ERROR constant expression depends on a generic parameter
//[min]~^^ ERROR generic parameters must not be used
//[min]~^^ ERROR generic parameters may not be used
Const
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/const-generics/issues/issue-61935.min.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: generic parameters must not be used inside const evaluations
error: generic parameters may not be used in const operations
--> $DIR/issue-61935.rs:10:23
|
LL | Self:FooImpl<{N==0}>
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments `N`
= help: const parameters may only be used as standalone arguments, i.e. `N`

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/const-generics/issues/issue-61935.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ impl<const N: usize> Foo for [(); N]
where
Self:FooImpl<{N==0}>
//[full]~^ERROR constant expression depends on a generic parameter
//[min]~^^ERROR generic parameters must not be used inside const evaluations
//[min]~^^ERROR generic parameters may not be used in const operations
{}

trait FooImpl<const IS_ZERO: bool>{}
Expand Down
Loading

0 comments on commit 79351b1

Please sign in to comment.