about summary refs log tree commit diff
path: root/tests/ui/const-generics/generic_const_exprs
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2024-09-08 01:49:25 -0400
committerNoah Lev <camelidcamel@gmail.com>2024-09-12 13:56:01 -0400
commite0bd01167e86d07c03e8ddd2bb0a25f689a2a7f5 (patch)
tree199eece79e78d0a347adfdad064c8791f8e562ef /tests/ui/const-generics/generic_const_exprs
parent8b75004bcad5f25ef31894986945ff75b53d7d94 (diff)
downloadrust-e0bd01167e86d07c03e8ddd2bb0a25f689a2a7f5.tar.gz
rust-e0bd01167e86d07c03e8ddd2bb0a25f689a2a7f5.zip
Re-enable `ConstArgKind::Path` lowering by default
...and remove the `const_arg_path` feature gate as a result. It was only
a stopgap measure to fix the regression that the new lowering introduced
(which should now be fixed by this PR).
Diffstat (limited to 'tests/ui/const-generics/generic_const_exprs')
-rw-r--r--tests/ui/const-generics/generic_const_exprs/type_mismatch.rs1
-rw-r--r--tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr12
-rw-r--r--tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs4
-rw-r--r--tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr4
4 files changed, 7 insertions, 14 deletions
diff --git a/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs b/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs
index a45deabbb0f..8e5e23b2337 100644
--- a/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs
+++ b/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs
@@ -8,7 +8,6 @@ trait Q {
 impl<const N: u64> Q for [u8; N] {}
 //~^ ERROR not all trait items implemented
 //~| ERROR the constant `N` is not of type `usize`
-//~| ERROR mismatched types
 
 pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {}
 //~^ ERROR the constant `13` is not of type `u64`
diff --git a/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr b/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr
index 68870a8d38d..e03580ec007 100644
--- a/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr
@@ -14,7 +14,7 @@ LL | impl<const N: u64> Q for [u8; N] {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `ASSOC` in implementation
 
 error: the constant `13` is not of type `u64`
-  --> $DIR/type_mismatch.rs:13:26
+  --> $DIR/type_mismatch.rs:12:26
    |
 LL | pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {}
    |                          ^^^^^^^^ expected `u64`, found `usize`
@@ -28,20 +28,14 @@ LL | impl<const N: u64> Q for [u8; N] {}
    |      unsatisfied trait bound introduced here
 
 error[E0308]: mismatched types
-  --> $DIR/type_mismatch.rs:13:20
+  --> $DIR/type_mismatch.rs:12:20
    |
 LL | pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {}
    |        ------      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `[u8; <[u8; 13] as Q>::ASSOC]`, found `()`
    |        |
    |        implicitly returns `()` as its body has no tail or `return` expression
 
-error[E0308]: mismatched types
-  --> $DIR/type_mismatch.rs:8:31
-   |
-LL | impl<const N: u64> Q for [u8; N] {}
-   |                               ^ expected `usize`, found `u64`
-
-error: aborting due to 5 previous errors
+error: aborting due to 4 previous errors
 
 Some errors have detailed explanations: E0046, E0308.
 For more information about an error, try `rustc --explain E0046`.
diff --git a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs
index 05a3487ffca..d11b457a3f6 100644
--- a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs
+++ b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs
@@ -25,8 +25,8 @@ mod v20 {
     }
 
     impl<const v10: usize> v17<v10, v2> {
-        //~^ ERROR maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#1}
-        //~| ERROR maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#1}
+        //~^ ERROR maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#0}
+        //~| ERROR maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#0}
         pub const fn v21() -> v18 {
             //~^ ERROR cannot find type `v18` in this scope
             v18 { _p: () }
diff --git a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr
index 39f022fbee9..15d3c472585 100644
--- a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr
@@ -72,13 +72,13 @@ help: add `#![feature(adt_const_params)]` to the crate attributes to enable more
 LL + #![feature(adt_const_params)]
    |
 
-error: maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#1}
+error: maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#0}
   --> $DIR/unevaluated-const-ice-119731.rs:27:37
    |
 LL |     impl<const v10: usize> v17<v10, v2> {
    |                                     ^^
 
-error: maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#1}
+error: maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#0}
   --> $DIR/unevaluated-const-ice-119731.rs:27:37
    |
 LL |     impl<const v10: usize> v17<v10, v2> {