generic_const_exprs: suggest to add the feature, not use it

This commit is contained in:
Ralf Jung 2023-11-30 20:59:51 +01:00
parent 07921b50ba
commit 1dbfe17f12
34 changed files with 74 additions and 74 deletions

View File

@ -200,7 +200,7 @@ resolve_param_in_non_trivial_anon_const =
.label = cannot perform const operation using `{$name}`
resolve_param_in_non_trivial_anon_const_help =
use `#![feature(generic_const_exprs)]` to allow generic const expressions
add `#![feature(generic_const_exprs)]` to allow generic const expressions
resolve_param_in_ty_of_const_param =
the type of const parameters must not depend on other generic parameters

View File

@ -5,7 +5,7 @@ LL | let _array: [u32; <A as Foo>::Y];
| ^ cannot perform const operation using `A`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View File

@ -5,7 +5,7 @@ LL | links: [u32; A::LINKS], // Shouldn't suggest bounds already there.
| ^^^^^^^^ cannot perform const operation using `A`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View File

@ -5,7 +5,7 @@ LL | let _: [u8; foo::<T>()];
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:16:23
@ -14,7 +14,7 @@ LL | let _: [u8; bar::<N>()];
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:18:23
@ -23,7 +23,7 @@ LL | let _: [u8; faz::<'a>(&())];
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:20:23
@ -32,7 +32,7 @@ LL | let _: [u8; baz::<'a>(&())];
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:21:23
@ -41,7 +41,7 @@ LL | let _: [u8; faz::<'b>(&())];
| ^^ cannot perform const operation using `'b`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:23:23
@ -50,7 +50,7 @@ LL | let _: [u8; baz::<'b>(&())];
| ^^ cannot perform const operation using `'b`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:26:23
@ -59,7 +59,7 @@ LL | let _ = [0; bar::<N>()];
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:28:23
@ -68,7 +68,7 @@ LL | let _ = [0; faz::<'a>(&())];
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:30:23
@ -77,7 +77,7 @@ LL | let _ = [0; baz::<'a>(&())];
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:31:23
@ -86,7 +86,7 @@ LL | let _ = [0; faz::<'b>(&())];
| ^^ cannot perform const operation using `'b`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:33:23
@ -95,7 +95,7 @@ LL | let _ = [0; baz::<'b>(&())];
| ^^ cannot perform const operation using `'b`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:34:24
@ -104,7 +104,7 @@ LL | let _: Foo<{ foo::<T>() }>;
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:35:24
@ -113,7 +113,7 @@ LL | let _: Foo<{ bar::<N>() }>;
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:37:24
@ -122,7 +122,7 @@ LL | let _: Foo<{ faz::<'a>(&()) }>;
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:39:24
@ -131,7 +131,7 @@ LL | let _: Foo<{ baz::<'a>(&()) }>;
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:40:24
@ -140,7 +140,7 @@ LL | let _: Foo<{ faz::<'b>(&()) }>;
| ^^ cannot perform const operation using `'b`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:42:24
@ -149,7 +149,7 @@ LL | let _: Foo<{ baz::<'b>(&()) }>;
| ^^ cannot perform const operation using `'b`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:43:27
@ -158,7 +158,7 @@ LL | let _ = Foo::<{ foo::<T>() }>;
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:44:27
@ -167,7 +167,7 @@ LL | let _ = Foo::<{ bar::<N>() }>;
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:46:27
@ -176,7 +176,7 @@ LL | let _ = Foo::<{ faz::<'a>(&()) }>;
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:48:27
@ -185,7 +185,7 @@ LL | let _ = Foo::<{ baz::<'a>(&()) }>;
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:49:27
@ -194,7 +194,7 @@ LL | let _ = Foo::<{ faz::<'b>(&()) }>;
| ^^ cannot perform const operation using `'b`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:51:27
@ -203,7 +203,7 @@ LL | let _ = Foo::<{ baz::<'b>(&()) }>;
| ^^ cannot perform const operation using `'b`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/const-arg-in-const-arg.rs:16:23

View File

@ -5,7 +5,7 @@ LL | pad: [u8; is_zst::<T>()],
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/const-argument-if-length.rs:15:12

View File

@ -5,7 +5,7 @@ LL | let _: &'a ();
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View File

@ -5,7 +5,7 @@ LL | struct Foo<const N: usize, const M: usize = { N + 1 }>;
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/complex-generic-default-expr.rs:9:62
@ -14,7 +14,7 @@ LL | struct Bar<T, const TYPE_SIZE: usize = { std::mem::size_of::<T>() }>(T);
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 2 previous errors

View File

@ -27,7 +27,7 @@ LL | let _: foo!({{ N }});
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/macro_rules-braces.rs:36:19
@ -36,7 +36,7 @@ LL | let _: bar!({ N });
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/macro_rules-braces.rs:41:20
@ -45,7 +45,7 @@ LL | let _: baz!({{ N }});
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/macro_rules-braces.rs:46:19
@ -54,7 +54,7 @@ LL | let _: biz!({ N });
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 6 previous errors

View File

@ -5,7 +5,7 @@ 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, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/array-size-in-generic-struct-param.rs:23:15
@ -14,7 +14,7 @@ LL | arr: [u8; CFG.arr_size],
| ^^^ cannot perform const operation using `CFG`
|
= help: const parameters may only be used as standalone arguments, i.e. `CFG`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: `Config` is forbidden as the type of a const generic parameter
--> $DIR/array-size-in-generic-struct-param.rs:21:21

View File

@ -5,7 +5,7 @@ LL | let _: [u8; size_of::<*mut T>()]; // error on stable, error with gce
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/dependence_lint.rs:21:37
@ -14,7 +14,7 @@ LL | let _: [u8; if true { size_of::<T>() } else { 3 }]; // error on stable,
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
warning: cannot use constants which depend on generic parameters in types
--> $DIR/dependence_lint.rs:10:9

View File

@ -5,7 +5,7 @@ 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, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View File

@ -5,7 +5,7 @@ LL | Condition<{ LHS <= RHS }>: True
| ^^^ cannot perform const operation using `LHS`
|
= help: const parameters may only be used as standalone arguments, i.e. `LHS`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/issue-72787.rs:11:24
@ -14,7 +14,7 @@ LL | Condition<{ LHS <= RHS }>: True
| ^^^ cannot perform const operation using `RHS`
|
= help: const parameters may only be used as standalone arguments, i.e. `RHS`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/issue-72787.rs:23:25
@ -23,7 +23,7 @@ LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
| ^ cannot perform const operation using `I`
|
= help: const parameters may only be used as standalone arguments, i.e. `I`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/issue-72787.rs:23:36
@ -32,7 +32,7 @@ LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
| ^ cannot perform const operation using `J`
|
= help: const parameters may only be used as standalone arguments, i.e. `J`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 4 previous errors

View File

@ -5,7 +5,7 @@ LL | where Assert::<{N < usize::MAX / 2}>: IsTrue,
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View File

@ -5,7 +5,7 @@ LL | let _: &'a ();
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0308]: mismatched types
--> $DIR/issue-74713.rs:3:10

View File

@ -5,7 +5,7 @@ LL | T: Trait<{std::intrinsics::type_name::<T>()}>
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic 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

View File

@ -5,7 +5,7 @@ LL | _a: [u8; std::mem::size_of::<&'a mut u8>()]
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0392]: parameter `'a` is never used
--> $DIR/issue-46511.rs:3:12

View File

@ -5,7 +5,7 @@ LL | inner: [(); { [|_: &T| {}; 0].len() }],
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0392]: parameter `T` is never used
--> $DIR/issue-67375.rs:5:12

View File

@ -5,7 +5,7 @@ LL | let x: S = MaybeUninit::uninit();
| ^ cannot perform const operation using `S`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/issue-67945-1.rs:13:45
@ -14,7 +14,7 @@ LL | let b = &*(&x as *const _ as *const S);
| ^ cannot perform const operation using `S`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0392]: parameter `S` is never used
--> $DIR/issue-67945-1.rs:7:12

View File

@ -5,7 +5,7 @@ LL | let x: Option<S> = None;
| ^ cannot perform const operation using `S`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0392]: parameter `S` is never used
--> $DIR/issue-67945-3.rs:9:12

View File

@ -5,7 +5,7 @@ LL | let x: Option<Box<S>> = None;
| ^ cannot perform const operation using `S`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0392]: parameter `S` is never used
--> $DIR/issue-67945-4.rs:8:12

View File

@ -5,7 +5,7 @@ LL | impl <const N: usize> Collatz<{Some(N)}> {}
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-68366.rs:11:7

View File

@ -5,7 +5,7 @@ LL | fn ty_param<T>() -> [u8; std::mem::size_of::<T>()] {
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/issue-76701-ty-param-in-const.rs:6:42
@ -14,7 +14,7 @@ LL | fn const_param<const N: usize>() -> [u8; N + 1] {
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 2 previous errors

View File

@ -5,7 +5,7 @@ LL | let _: [u8; sof::<T>()];
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View File

@ -5,7 +5,7 @@ LL | struct MyArray<const COUNT: usize>([u8; COUNT + 1]);
| ^^^^^ cannot perform const operation using `COUNT`
|
= help: const parameters may only be used as standalone arguments, i.e. `COUNT`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View File

@ -13,7 +13,7 @@ LL | legacy_const_generics::foo(0, N + 1, 2);
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 2 previous errors

View File

@ -5,7 +5,7 @@ LL | struct Break0<const N: usize>([u8; { N + 1 }]);
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/complex-expression.rs:13:40
@ -14,7 +14,7 @@ LL | struct Break1<const N: usize>([u8; { { N } }]);
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/complex-expression.rs:17:17
@ -23,7 +23,7 @@ LL | let _: [u8; N + 1];
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/complex-expression.rs:22:17
@ -32,7 +32,7 @@ LL | let _ = [0; N + 1];
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/complex-expression.rs:26:45
@ -41,7 +41,7 @@ LL | struct BreakTy0<T>(T, [u8; { size_of::<*mut T>() }]);
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/complex-expression.rs:29:47
@ -50,7 +50,7 @@ LL | struct BreakTy1<T>(T, [u8; { { size_of::<*mut T>() } }]);
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/complex-expression.rs:33:32
@ -59,7 +59,7 @@ LL | let _: [u8; size_of::<*mut T>() + 1];
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
warning: cannot use constants which depend on generic parameters in types
--> $DIR/complex-expression.rs:38:17

View File

@ -5,7 +5,7 @@ LL | test::<{ let _: &'a (); 3 },>();
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/forbid-non-static-lifetimes.rs:21:16
@ -14,7 +14,7 @@ LL | [(); (|_: &'a u8| (), 0).1];
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 2 previous errors

View File

@ -5,7 +5,7 @@ LL | fn t1() -> [u8; std::mem::size_of::<Self>()];
| ^^^^ cannot perform const operation using `Self`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic `Self` types are currently not permitted in anonymous constants
--> $DIR/self-ty-in-const-1.rs:12:41

View File

@ -5,7 +5,7 @@ LL | let x: &'a ();
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View File

@ -11,7 +11,7 @@ LL | struct Foo<T, U = [u8; std::mem::size_of::<T>()]>(T, U);
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0128]: generic parameters with a default cannot use forward declared identifiers
--> $DIR/params-in-ct-in-ty-param-lazy-norm.rs:8:21

View File

@ -5,7 +5,7 @@ LL | let _arr: [u8; size_of::<T>()];
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View File

@ -5,7 +5,7 @@ LL | struct Foo<T, U = [u8; std::mem::size_of::<T>()]>(T, U);
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error

View File

@ -5,7 +5,7 @@ LL | beta: [(); foo::<&'a ()>()],
| ^^ cannot perform const operation using `'a`
|
= note: lifetime parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic `Self` types are currently not permitted in anonymous constants
--> $DIR/issue-64173-unused-lifetimes.rs:4:28

View File

@ -5,7 +5,7 @@ LL | entries: [T; D::dim()],
| ^^^^^^ cannot perform const operation using `D`
|
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 1 previous error