about summary refs log tree commit diff
path: root/tests/ui/block-result
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2023-01-02 18:00:33 -0800
committerEsteban Küber <esteban@kuber.com.ar>2023-01-30 20:12:19 +0000
commit62ba3e70a1f01d801d068b84a097e38bd82a8c6e (patch)
treee7834f2924d6a0aa0ef7eddb6bb9b2db50b2be1d /tests/ui/block-result
parent006ca9b14da1e0145844598b3d6a554c042c702a (diff)
downloadrust-62ba3e70a1f01d801d068b84a097e38bd82a8c6e.tar.gz
rust-62ba3e70a1f01d801d068b84a097e38bd82a8c6e.zip
Modify primary span label for E0308
The previous output was unintuitive to users.
Diffstat (limited to 'tests/ui/block-result')
-rw-r--r--tests/ui/block-result/consider-removing-last-semi.stderr4
-rw-r--r--tests/ui/block-result/issue-13428.stderr4
-rw-r--r--tests/ui/block-result/issue-13624.rs4
-rw-r--r--tests/ui/block-result/issue-13624.stderr4
-rw-r--r--tests/ui/block-result/issue-22645.stderr2
-rw-r--r--tests/ui/block-result/issue-5500.rs2
-rw-r--r--tests/ui/block-result/issue-5500.stderr2
7 files changed, 11 insertions, 11 deletions
diff --git a/tests/ui/block-result/consider-removing-last-semi.stderr b/tests/ui/block-result/consider-removing-last-semi.stderr
index 9be0367ae38..d30ab129343 100644
--- a/tests/ui/block-result/consider-removing-last-semi.stderr
+++ b/tests/ui/block-result/consider-removing-last-semi.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/consider-removing-last-semi.rs:3:15
    |
 LL | pub fn f() -> String {
-   |        -      ^^^^^^ expected struct `String`, found `()`
+   |        -      ^^^^^^ expected `String`, found `()`
    |        |
    |        implicitly returns `()` as its body has no tail or `return` expression
 LL |     0u8;
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
   --> $DIR/consider-removing-last-semi.rs:8:15
    |
 LL | pub fn g() -> String {
-   |        -      ^^^^^^ expected struct `String`, found `()`
+   |        -      ^^^^^^ expected `String`, found `()`
    |        |
    |        implicitly returns `()` as its body has no tail or `return` expression
 LL |     "this won't work".to_string();
diff --git a/tests/ui/block-result/issue-13428.stderr b/tests/ui/block-result/issue-13428.stderr
index 2b386d10c53..c119b69da22 100644
--- a/tests/ui/block-result/issue-13428.stderr
+++ b/tests/ui/block-result/issue-13428.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-13428.rs:3:13
    |
 LL | fn foo() -> String {
-   |    ---      ^^^^^^ expected struct `String`, found `()`
+   |    ---      ^^^^^^ expected `String`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
 
@@ -10,7 +10,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-13428.rs:11:13
    |
 LL | fn bar() -> String {
-   |    ---      ^^^^^^ expected struct `String`, found `()`
+   |    ---      ^^^^^^ expected `String`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
 LL |     "foobar".to_string()
diff --git a/tests/ui/block-result/issue-13624.rs b/tests/ui/block-result/issue-13624.rs
index 4d2844cc5ae..8f93e5a356f 100644
--- a/tests/ui/block-result/issue-13624.rs
+++ b/tests/ui/block-result/issue-13624.rs
@@ -6,7 +6,7 @@ mod a {
   pub fn get_enum_struct_variant() -> () {
     Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
     //~^ ERROR mismatched types
-    //~| expected `()`, found enum `Enum`
+    //~| expected `()`, found `Enum`
   }
 }
 
@@ -19,7 +19,7 @@ mod b {
       match enum_struct_variant {
         a::Enum::EnumStructVariant { x, y, z } => {
         //~^ ERROR mismatched types
-        //~| expected `()`, found enum `Enum`
+        //~| expected `()`, found `Enum`
         }
       }
     }
diff --git a/tests/ui/block-result/issue-13624.stderr b/tests/ui/block-result/issue-13624.stderr
index 13070b4e821..d41bd057f82 100644
--- a/tests/ui/block-result/issue-13624.stderr
+++ b/tests/ui/block-result/issue-13624.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |   pub fn get_enum_struct_variant() -> () {
    |                                       -- expected `()` because of return type
 LL |     Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found enum `Enum`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Enum`
 
 error[E0308]: mismatched types
   --> $DIR/issue-13624.rs:20:9
@@ -12,7 +12,7 @@ error[E0308]: mismatched types
 LL |       match enum_struct_variant {
    |             ------------------- this expression has type `()`
 LL |         a::Enum::EnumStructVariant { x, y, z } => {
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found enum `Enum`
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Enum`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/block-result/issue-22645.stderr b/tests/ui/block-result/issue-22645.stderr
index 24341c0f58a..677b40aaa9d 100644
--- a/tests/ui/block-result/issue-22645.stderr
+++ b/tests/ui/block-result/issue-22645.stderr
@@ -20,7 +20,7 @@ LL | fn main() {
    |           - expected `()` because of default return type
 LL |   let b = Bob + 3.5;
 LL |   b + 3
-   |   ^^^^^ expected `()`, found struct `Bob`
+   |   ^^^^^ expected `()`, found `Bob`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/block-result/issue-5500.rs b/tests/ui/block-result/issue-5500.rs
index 577987a4596..de7fd39a20c 100644
--- a/tests/ui/block-result/issue-5500.rs
+++ b/tests/ui/block-result/issue-5500.rs
@@ -3,5 +3,5 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected unit type `()`
     //~| found reference `&_`
-    //~| expected `()`, found reference
+    //~| expected `()`, found `&_`
 }
diff --git a/tests/ui/block-result/issue-5500.stderr b/tests/ui/block-result/issue-5500.stderr
index 211a6052864..8cd4bd65871 100644
--- a/tests/ui/block-result/issue-5500.stderr
+++ b/tests/ui/block-result/issue-5500.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn main() {
    |           - expected `()` because of default return type
 LL |     &panic!()
-   |     ^^^^^^^^^ expected `()`, found reference
+   |     ^^^^^^^^^ expected `()`, found `&_`
    |
    = note: expected unit type `()`
               found reference `&_`