summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/min_const_generics
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /tests/ui/const-generics/min_const_generics
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/const-generics/min_const_generics')
-rw-r--r--tests/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs4
-rw-r--r--tests/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr17
2 files changed, 10 insertions, 11 deletions
diff --git a/tests/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs b/tests/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs
index 6215b7d93..86f2bc9c7 100644
--- a/tests/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs
+++ b/tests/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs
@@ -5,7 +5,7 @@ fn test<const N: usize>() {}
fn issue_75323_and_74447_1<'a>() -> &'a () {
test::<{ let _: &'a (); 3 },>();
- //~^ ERROR a non-static lifetime is not allowed in a `const`
+ //~^ ERROR generic parameters may not be used in const operations
&()
}
@@ -19,7 +19,7 @@ fn issue_75323_and_74447_3() {
fn issue_73375<'a>() {
[(); (|_: &'a u8| (), 0).1];
- //~^ ERROR a non-static lifetime is not allowed in a `const`
+ //~^ ERROR generic parameters may not be used in const operations
}
fn main() {}
diff --git a/tests/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr b/tests/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr
index 5f641b070..7726016eb 100644
--- a/tests/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr
+++ b/tests/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr
@@ -1,21 +1,20 @@
-error[E0658]: a non-static lifetime is not allowed in a `const`
+error: generic parameters may not be used in const operations
--> $DIR/forbid-non-static-lifetimes.rs:7:22
|
LL | test::<{ let _: &'a (); 3 },>();
- | ^^
+ | ^^ cannot perform const operation using `'a`
|
- = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
- = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
+ = note: lifetime parameters may not be used in const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
-error[E0658]: a non-static lifetime is not allowed in a `const`
+error: generic parameters may not be used in const operations
--> $DIR/forbid-non-static-lifetimes.rs:21:16
|
LL | [(); (|_: &'a u8| (), 0).1];
- | ^^
+ | ^^ cannot perform const operation using `'a`
|
- = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
- = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
+ = note: lifetime parameters may not be used in const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0658`.