Skip to content

Commit 79351b1

Browse files
committed
Bless expected errors
1 parent facb38d commit 79351b1

File tree

54 files changed

+132
-132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+132
-132
lines changed

src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
error: generic parameters must not be used inside const evaluations
1+
error: generic parameters may not be used in const operations
22
--> $DIR/array-size-in-generic-struct-param.rs:9:48
33
|
44
LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
55
| ^ cannot perform const operation using `N`
66
|
7-
= help: const parameters may only be used as standalone arguments `N`
7+
= help: const parameters may only be used as standalone arguments, i.e. `N`
88

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

1717
error: `Config` is forbidden as the type of a const generic parameter
1818
--> $DIR/array-size-in-generic-struct-param.rs:18:21

src/test/ui/const-generics/array-size-in-generic-struct-param.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#[allow(dead_code)]
99
struct ArithArrayLen<const N: usize>([u32; 0 + N]);
1010
//[full]~^ ERROR constant expression depends on a generic parameter
11-
//[min]~^^ ERROR generic parameters must not be used inside const evaluations
11+
//[min]~^^ ERROR generic parameters may not be used in const operations
1212

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

2525
const C: Config = Config { arr_size: 5 };

src/test/ui/const-generics/const-argument-if-length.min.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: generic parameters must not be used inside const evaluations
1+
error: generic parameters may not be used in const operations
22
--> $DIR/const-argument-if-length.rs:19:24
33
|
44
LL | pad: [u8; is_zst::<T>()],
55
| ^ cannot perform const operation using `T`
66
|
7-
= note: type parameters may not be used in anonymous constants
7+
= note: type parameters may not be used in const expressions
88

99
error[E0277]: the size for values of type `T` cannot be known at compilation time
1010
--> $DIR/const-argument-if-length.rs:17:12

src/test/ui/const-generics/const-argument-if-length.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct AtLeastByte<T: ?Sized> {
1717
value: T,
1818
//~^ ERROR the size for values of type `T` cannot be known at compilation time
1919
pad: [u8; is_zst::<T>()],
20-
//[min]~^ ERROR generic parameters must not be used inside const evaluations
20+
//[min]~^ ERROR generic parameters may not be used in const operations
2121
//[full]~^^ ERROR evaluation of constant value failed
2222
}
2323

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

99
error: aborting due to previous error
1010

src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![cfg_attr(min, feature(min_const_generics))]
55

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

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

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

1717
error: aborting due to 2 previous errors
1818

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

99
error: aborting due to previous error
1010

src/test/ui/const-generics/const_evaluatable_checked/simple_fail.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#![allow(incomplete_features)]
66

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

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

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

1717
error: aborting due to 2 previous errors
1818

src/test/ui/const-generics/generic-function-call-in-array-length.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
const fn foo(n: usize) -> usize { n * 2 }
88

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

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

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

1717
error: aborting due to 2 previous errors
1818

src/test/ui/const-generics/generic-sum-in-array-length.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#![cfg_attr(min, feature(min_const_generics))]
66

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

1212
fn main() {}

src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr

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

99
error: `&'static str` is forbidden as the type of a const generic parameter
1010
--> $DIR/intrinsics-type_name-as-const-argument.rs:10:22

src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trait Trait<const S: &'static str> {}
1313
struct Bug<T>
1414
where
1515
T: Trait<{std::intrinsics::type_name::<T>()}>
16-
//[min]~^ ERROR generic parameters must not be used inside const evaluations
16+
//[min]~^ ERROR generic parameters may not be used in const operations
1717
//[full]~^^ ERROR constant expression depends on a generic parameter
1818
{
1919
t: T
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
error: generic parameters must not be used inside const evaluations
1+
error: generic parameters may not be used in const operations
22
--> $DIR/issue-61522-array-len-succ.rs:7:45
33
|
44
LL | pub struct MyArray<const COUNT: usize>([u8; COUNT + 1]);
55
| ^^^^^ cannot perform const operation using `COUNT`
66
|
7-
= help: const parameters may only be used as standalone arguments `COUNT`
7+
= help: const parameters may only be used as standalone arguments, i.e. `COUNT`
88

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

1717
error: aborting due to 2 previous errors
1818

src/test/ui/const-generics/issue-61522-array-len-succ.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

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

1111
impl<const COUNT: usize> MyArray<COUNT> {
1212
fn inner(&self) -> &[u8; COUNT + 1] {
1313
//[full]~^ ERROR constant expression depends on a generic parameter
14-
//[min]~^^ ERROR generic parameters must not be used
14+
//[min]~^^ ERROR generic parameters may not be used
1515
&self.0
1616
}
1717
}

src/test/ui/const-generics/issue-67375.min.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: generic parameters must not be used inside const evaluations
1+
error: generic parameters may not be used in const operations
22
--> $DIR/issue-67375.rs:9:25
33
|
44
LL | inner: [(); { [|_: &T| {}; 0].len() }],
55
| ^ cannot perform const operation using `T`
66
|
7-
= note: type parameters may not be used in anonymous constants
7+
= note: type parameters may not be used in const expressions
88

99
error[E0392]: parameter `T` is never used
1010
--> $DIR/issue-67375.rs:7:12

src/test/ui/const-generics/issue-67375.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
struct Bug<T> {
88
//~^ ERROR parameter `T` is never used
99
inner: [(); { [|_: &T| {}; 0].len() }],
10-
//[min]~^ ERROR generic parameters must not be used inside const evaluations
10+
//[min]~^ ERROR generic parameters may not be used in const operations
1111
//[full]~^^ WARN cannot use constants which depend on generic parameters in types
1212
//[full]~^^^ WARN this was previously accepted by the compiler
1313
}

src/test/ui/const-generics/issue-67945-1.min.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
error: generic parameters must not be used inside const evaluations
1+
error: generic parameters may not be used in const operations
22
--> $DIR/issue-67945-1.rs:14:16
33
|
44
LL | let x: S = MaybeUninit::uninit();
55
| ^ cannot perform const operation using `S`
66
|
7-
= note: type parameters may not be used in anonymous constants
7+
= note: type parameters may not be used in const expressions
88

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

1717
error[E0392]: parameter `S` is never used
1818
--> $DIR/issue-67945-1.rs:11:12

src/test/ui/const-generics/issue-67945-1.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ struct Bug<S> {
1212
//~^ ERROR parameter `S` is never used
1313
A: [(); {
1414
let x: S = MaybeUninit::uninit();
15-
//[min]~^ ERROR generic parameters must not be used inside const evaluations
15+
//[min]~^ ERROR generic parameters may not be used in const operations
1616
//[full]~^^ ERROR mismatched types
1717
let b = &*(&x as *const _ as *const S);
18-
//[min]~^ ERROR generic parameters must not be used inside const evaluations
18+
//[min]~^ ERROR generic parameters may not be used in const operations
1919
0
2020
}],
2121
}

src/test/ui/const-generics/issue-67945-2.min.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
error: generic parameters must not be used inside const evaluations
1+
error: generic parameters may not be used in const operations
22
--> $DIR/issue-67945-2.rs:12:16
33
|
44
LL | let x: S = MaybeUninit::uninit();
55
| ^ cannot perform const operation using `S`
66
|
7-
= note: type parameters may not be used in anonymous constants
7+
= note: type parameters may not be used in const expressions
88

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

1717
error[E0392]: parameter `S` is never used
1818
--> $DIR/issue-67945-2.rs:9:12

src/test/ui/const-generics/issue-67945-2.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ struct Bug<S> {
1010
//~^ ERROR parameter `S` is never used
1111
A: [(); {
1212
let x: S = MaybeUninit::uninit();
13-
//[min]~^ ERROR generic parameters must not be used inside const evaluations
13+
//[min]~^ ERROR generic parameters may not be used in const operations
1414
//[full]~^^ ERROR mismatched types
1515
let b = &*(&x as *const _ as *const S);
16-
//[min]~^ ERROR generic parameters must not be used inside const evaluations
16+
//[min]~^ ERROR generic parameters may not be used in const operations
1717
0
1818
}],
1919
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: generic parameters must not be used inside const evaluations
1+
error: generic parameters may not be used in const operations
22
--> $DIR/issue-61747.rs:8:30
33
|
44
LL | fn successor() -> Const<{C + 1}> {
55
| ^ cannot perform const operation using `C`
66
|
7-
= help: const parameters may only be used as standalone arguments `C`
7+
= help: const parameters may only be used as standalone arguments, i.e. `C`
88

99
error: aborting due to previous error
1010

src/test/ui/const-generics/issues/issue-61747.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ struct Const<const N: usize>;
77
impl<const C: usize> Const<{C}> {
88
fn successor() -> Const<{C + 1}> {
99
//[full]~^ ERROR constant expression depends on a generic parameter
10-
//[min]~^^ ERROR generic parameters must not be used
10+
//[min]~^^ ERROR generic parameters may not be used
1111
Const
1212
}
1313
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: generic parameters must not be used inside const evaluations
1+
error: generic parameters may not be used in const operations
22
--> $DIR/issue-61935.rs:10:23
33
|
44
LL | Self:FooImpl<{N==0}>
55
| ^ cannot perform const operation using `N`
66
|
7-
= help: const parameters may only be used as standalone arguments `N`
7+
= help: const parameters may only be used as standalone arguments, i.e. `N`
88

99
error: aborting due to previous error
1010

src/test/ui/const-generics/issues/issue-61935.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ impl<const N: usize> Foo for [(); N]
99
where
1010
Self:FooImpl<{N==0}>
1111
//[full]~^ERROR constant expression depends on a generic parameter
12-
//[min]~^^ERROR generic parameters must not be used inside const evaluations
12+
//[min]~^^ERROR generic parameters may not be used in const operations
1313
{}
1414

1515
trait FooImpl<const IS_ZERO: bool>{}

0 commit comments

Comments
 (0)