about summary refs log tree commit diff
path: root/tests/ui/const-generics
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-07-20 17:58:05 -0400
committerMichael Goulet <michael@errs.io>2024-07-20 19:45:24 -0400
commit3862095bd214a3ebdfb3fbaa4a13eac2ad8de331 (patch)
tree0bcd0cde157f5ffb11fb1512366c1e6685e24642 /tests/ui/const-generics
parent2e6fc425411280c658d852813de01c5157255088 (diff)
downloadrust-3862095bd214a3ebdfb3fbaa4a13eac2ad8de331.tar.gz
rust-3862095bd214a3ebdfb3fbaa4a13eac2ad8de331.zip
Just totally fully deny late-bound consts
Diffstat (limited to 'tests/ui/const-generics')
-rw-r--r--tests/ui/const-generics/generic_const_exprs/no-entry-found-for-key-ice-gce-nlb-113133.rs3
-rw-r--r--tests/ui/const-generics/generic_const_exprs/no-entry-found-for-key-ice-gce-nlb-113133.stderr8
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/ui/const-generics/generic_const_exprs/no-entry-found-for-key-ice-gce-nlb-113133.rs b/tests/ui/const-generics/generic_const_exprs/no-entry-found-for-key-ice-gce-nlb-113133.rs
index 5673f1dd073..ffa9d960e04 100644
--- a/tests/ui/const-generics/generic_const_exprs/no-entry-found-for-key-ice-gce-nlb-113133.rs
+++ b/tests/ui/const-generics/generic_const_exprs/no-entry-found-for-key-ice-gce-nlb-113133.rs
@@ -7,7 +7,8 @@
 pub fn foo()
 where
     for<const N: usize = { const fn bar() {} bar(); 1 }> ():,
-    //~^ ERROR defaults for generic parameters are not allowed in `for<...>` binders
+    //~^ ERROR late-bound const parameters cannot be used currently
+    //~| ERROR defaults for generic parameters are not allowed in `for<...>` binders
 {}
 
 fn main() {}
diff --git a/tests/ui/const-generics/generic_const_exprs/no-entry-found-for-key-ice-gce-nlb-113133.stderr b/tests/ui/const-generics/generic_const_exprs/no-entry-found-for-key-ice-gce-nlb-113133.stderr
index 5924a673da9..814022f26b9 100644
--- a/tests/ui/const-generics/generic_const_exprs/no-entry-found-for-key-ice-gce-nlb-113133.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/no-entry-found-for-key-ice-gce-nlb-113133.stderr
@@ -1,8 +1,14 @@
+error: late-bound const parameters cannot be used currently
+  --> $DIR/no-entry-found-for-key-ice-gce-nlb-113133.rs:9:15
+   |
+LL |     for<const N: usize = { const fn bar() {} bar(); 1 }> ():,
+   |               ^
+
 error: defaults for generic parameters are not allowed in `for<...>` binders
   --> $DIR/no-entry-found-for-key-ice-gce-nlb-113133.rs:9:9
    |
 LL |     for<const N: usize = { const fn bar() {} bar(); 1 }> ():,
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 1 previous error
+error: aborting due to 2 previous errors