about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-07-09 11:28:06 +0530
committerGitHub <noreply@github.com>2022-07-09 11:28:06 +0530
commitd75a5723dbc9bbc58bf7614b3a729bf5d359290b (patch)
tree523526c29196dd7f3c2815a788bdf2a5763af548 /src
parenta6c6166d7be30e38ee7e42370e14899c9e061f66 (diff)
parent1b32eb34b36db37902afcaefd49a8da6167cbd30 (diff)
downloadrust-d75a5723dbc9bbc58bf7614b3a729bf5d359290b.tar.gz
rust-d75a5723dbc9bbc58bf7614b3a729bf5d359290b.zip
Rollup merge of #99008 - obeis:issue-98974, r=compiler-errors
Adding suggestion for E0530

Closes #98974
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/empty/empty-struct-tuple-pat.stderr10
-rw-r--r--src/test/ui/pattern/pat-tuple-field-count-cross.stderr5
-rw-r--r--src/test/ui/pattern/pat-tuple-overfield.stderr5
-rw-r--r--src/test/ui/pattern/pattern-binding-disambiguation.stderr10
4 files changed, 24 insertions, 6 deletions
diff --git a/src/test/ui/empty/empty-struct-tuple-pat.stderr b/src/test/ui/empty/empty-struct-tuple-pat.stderr
index 9f44747381a..8d0f75d204c 100644
--- a/src/test/ui/empty/empty-struct-tuple-pat.stderr
+++ b/src/test/ui/empty/empty-struct-tuple-pat.stderr
@@ -5,7 +5,10 @@ LL | struct Empty2();
    | ---------------- the tuple struct `Empty2` is defined here
 ...
 LL |         Empty2 => ()
-   |         ^^^^^^ cannot be named the same as a tuple struct
+   |         ^^^^^^
+   |         |
+   |         cannot be named the same as a tuple struct
+   |         help: try specify the pattern arguments: `Empty2(..)`
 
 error[E0530]: match bindings cannot shadow tuple structs
   --> $DIR/empty-struct-tuple-pat.rs:25:9
@@ -14,7 +17,10 @@ LL | use empty_struct::*;
    |     --------------- the tuple struct `XEmpty6` is imported here
 ...
 LL |         XEmpty6 => ()
-   |         ^^^^^^^ cannot be named the same as a tuple struct
+   |         ^^^^^^^
+   |         |
+   |         cannot be named the same as a tuple struct
+   |         help: try specify the pattern arguments: `XEmpty6(..)`
 
 error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E::Empty4`
   --> $DIR/empty-struct-tuple-pat.rs:29:9
diff --git a/src/test/ui/pattern/pat-tuple-field-count-cross.stderr b/src/test/ui/pattern/pat-tuple-field-count-cross.stderr
index c0cc56aa86e..d9295746158 100644
--- a/src/test/ui/pattern/pat-tuple-field-count-cross.stderr
+++ b/src/test/ui/pattern/pat-tuple-field-count-cross.stderr
@@ -5,7 +5,10 @@ LL | use declarations_for_tuple_field_count_errors::*;
    |     -------------------------------------------- the tuple struct `Z1` is imported here
 ...
 LL |         Z1 => {}
-   |         ^^ cannot be named the same as a tuple struct
+   |         ^^
+   |         |
+   |         cannot be named the same as a tuple struct
+   |         help: try specify the pattern arguments: `Z1(..)`
 
 error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0`
   --> $DIR/pat-tuple-field-count-cross.rs:9:9
diff --git a/src/test/ui/pattern/pat-tuple-overfield.stderr b/src/test/ui/pattern/pat-tuple-overfield.stderr
index 856e7918cb7..54d89e03101 100644
--- a/src/test/ui/pattern/pat-tuple-overfield.stderr
+++ b/src/test/ui/pattern/pat-tuple-overfield.stderr
@@ -5,7 +5,10 @@ LL | struct Z1();
    | ------------ the tuple struct `Z1` is defined here
 ...
 LL |         Z1 => {}
-   |         ^^ cannot be named the same as a tuple struct
+   |         ^^
+   |         |
+   |         cannot be named the same as a tuple struct
+   |         help: try specify the pattern arguments: `Z1(..)`
 
 error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0`
   --> $DIR/pat-tuple-overfield.rs:52:9
diff --git a/src/test/ui/pattern/pattern-binding-disambiguation.stderr b/src/test/ui/pattern/pattern-binding-disambiguation.stderr
index faa0d7c3074..1529e538b55 100644
--- a/src/test/ui/pattern/pattern-binding-disambiguation.stderr
+++ b/src/test/ui/pattern/pattern-binding-disambiguation.stderr
@@ -5,7 +5,10 @@ LL | struct TupleStruct();
    | --------------------- the tuple struct `TupleStruct` is defined here
 ...
 LL |         TupleStruct => {}
-   |         ^^^^^^^^^^^ cannot be named the same as a tuple struct
+   |         ^^^^^^^^^^^
+   |         |
+   |         cannot be named the same as a tuple struct
+   |         help: try specify the pattern arguments: `TupleStruct(..)`
 
 error[E0530]: match bindings cannot shadow tuple variants
   --> $DIR/pattern-binding-disambiguation.rs:33:9
@@ -14,7 +17,10 @@ LL | use E::*;
    |     ---- the tuple variant `TupleVariant` is imported here
 ...
 LL |         TupleVariant => {}
-   |         ^^^^^^^^^^^^ cannot be named the same as a tuple variant
+   |         ^^^^^^^^^^^^
+   |         |
+   |         cannot be named the same as a tuple variant
+   |         help: try specify the pattern arguments: `TupleVariant(..)`
 
 error[E0530]: match bindings cannot shadow struct variants
   --> $DIR/pattern-binding-disambiguation.rs:36:9