about summary refs log tree commit diff
path: root/tests/ui/const_prop
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-11-20 02:37:56 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-12-04 20:29:35 +0000
commitcc492edc9d65125a25a42446bbffefb8087dedf1 (patch)
tree7c598aa8fd7463f6f6aa6f126286260758dd60e6 /tests/ui/const_prop
parentc6205055e085a1210c1503978225d34147a0d8bd (diff)
downloadrust-cc492edc9d65125a25a42446bbffefb8087dedf1.tar.gz
rust-cc492edc9d65125a25a42446bbffefb8087dedf1.zip
Tweak unevaluated constant in pattern error
Silence errors that are implied by the errors in the `const` item definition.

Add a primary span label.
Diffstat (limited to 'tests/ui/const_prop')
-rw-r--r--tests/ui/const_prop/ice-type-mismatch-when-copying-112824.rs3
-rw-r--r--tests/ui/const_prop/ice-type-mismatch-when-copying-112824.stderr13
2 files changed, 2 insertions, 14 deletions
diff --git a/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.rs b/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.rs
index 09f7e2ba5b1..270496d45a6 100644
--- a/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.rs
+++ b/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.rs
@@ -12,8 +12,7 @@ impl Opcode2 {
 
 pub fn example2(msg_type: Opcode2) -> impl FnMut(&[u8]) {
     move |i| match msg_type {
-        Opcode2::OP2 => unimplemented!(),
-        //~^ ERROR: could not evaluate constant pattern
+        Opcode2::OP2 => unimplemented!(), // ok, `const` already emitted an error
     }
 }
 
diff --git a/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.stderr b/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.stderr
index 9cce6fee55a..d95a8861230 100644
--- a/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.stderr
+++ b/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.stderr
@@ -17,18 +17,7 @@ help: you might be missing a type parameter
 LL | pub struct Opcode2<S>(&'a S);
    |                   +++
 
-error: could not evaluate constant pattern
-  --> $DIR/ice-type-mismatch-when-copying-112824.rs:15:9
-   |
-LL | impl Opcode2 {
-   | ------------
-LL |     pub const OP2: Opcode2 = Opcode2(Opcode(0x1));
-   |     ---------------------- constant defined here
-...
-LL |         Opcode2::OP2 => unimplemented!(),
-   |         ^^^^^^^^^^^^
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
 
 Some errors have detailed explanations: E0261, E0412.
 For more information about an error, try `rustc --explain E0261`.