]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/type/type-check/assignment-in-if.stderr
Remove E0308 note when primary label has all info
[rust.git] / src / test / ui / type / type-check / assignment-in-if.stderr
index 403f7b4f7ae89b9f103977d085f6922ac14a06bb..789902bbb94559e6f4dcf98aeac82102d3b8df3e 100644 (file)
@@ -6,9 +6,6 @@ LL |     if x = x {
    |        |
    |        expected bool, found ()
    |        help: try comparing for equality: `x == x`
-   |
-   = note: expected type `bool`
-              found type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-in-if.rs:20:8
@@ -18,9 +15,6 @@ LL |     if (x = x) {
    |        |
    |        expected bool, found ()
    |        help: try comparing for equality: `x == x`
-   |
-   = note: expected type `bool`
-              found type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-in-if.rs:25:8
@@ -30,9 +24,6 @@ LL |     if y = (Foo { foo: x }) {
    |        |
    |        expected bool, found ()
    |        help: try comparing for equality: `y == (Foo { foo: x })`
-   |
-   = note: expected type `bool`
-              found type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-in-if.rs:30:8
@@ -42,19 +33,25 @@ LL |     if 3 = x {
    |        |
    |        expected bool, found ()
    |        help: try comparing for equality: `3 == x`
-   |
-   = note: expected type `bool`
-              found type `()`
 
 error[E0308]: mismatched types
-  --> $DIR/assignment-in-if.rs:34:8
+  --> $DIR/assignment-in-if.rs:36:13
    |
-LL |     if (if true { x = 4 } else { x = 5 }) {
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found ()
+LL |             x = 4
+   |             ^^^^^
+   |             |
+   |             expected bool, found ()
+   |             help: try comparing for equality: `x == 4`
+
+error[E0308]: mismatched types
+  --> $DIR/assignment-in-if.rs:38:13
    |
-   = note: expected type `bool`
-              found type `()`
+LL |             x = 5
+   |             ^^^^^
+   |             |
+   |             expected bool, found ()
+   |             help: try comparing for equality: `x == 5`
 
-error: aborting due to 5 previous errors
+error: aborting due to 6 previous errors
 
 For more information about this error, try `rustc --explain E0308`.