summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /tests/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr')
-rw-r--r--tests/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr b/tests/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr
new file mode 100644
index 000000000..74111ef1d
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr
@@ -0,0 +1,34 @@
+error: overly complex generic constant
+ --> $DIR/dependence_lint.rs:17:9
+ |
+LL | [0; if false { size_of::<T>() } else { 3 }]; // lint on stable, error with gce
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ control flow is not supported in generic constants
+ |
+ = help: consider moving this anonymous constant into a `const` function
+
+error: overly complex generic constant
+ --> $DIR/dependence_lint.rs:21:17
+ |
+LL | let _: [u8; if true { size_of::<T>() } else { 3 }]; // error on stable, error with gce
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ control flow is not supported in generic constants
+ |
+ = help: consider moving this anonymous constant into a `const` function
+
+error: unconstrained generic constant
+ --> $DIR/dependence_lint.rs:14:12
+ |
+LL | let _: [u8; size_of::<*mut T>()]; // error on stable, error with gce
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); size_of::<*mut T>()]:`
+
+error: unconstrained generic constant
+ --> $DIR/dependence_lint.rs:10:9
+ |
+LL | [0; size_of::<*mut T>()]; // lint on stable, error with `generic_const_exprs`
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); size_of::<*mut T>()]:`
+
+error: aborting due to 4 previous errors
+