about summary refs log tree commit diff
path: root/src/test/debuginfo/enum-thinlto.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-09-26 17:16:34 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-09-28 09:56:28 -0700
commit8a167edbcad1497b05c5d4d674acac34217902d0 (patch)
treeca1b19bd63758809ac1186b518b1809bcbee5f4d /src/test/debuginfo/enum-thinlto.rs
parent18f00b949615b1faa7feec95d58b087d146d3198 (diff)
downloadrust-8a167edbcad1497b05c5d4d674acac34217902d0.tar.gz
rust-8a167edbcad1497b05c5d4d674acac34217902d0.zip
Point at enclosing match when expecting `()` in arm
When encountering code like the following:

```rust
fn main() {
    match 3 {
        4 => 1,
        3 => {
            println!("Yep it maches.");
            2
        }
        _ => 2
    }
    println!("Bye!")
}
```

point at the enclosing `match` expression and suggest ignoring the
returned value:

```
error[E0308]: mismatched types
  --> $DIR/match-needing-semi.rs:8:13
   |
LL | /     match 3 {
LL | |         4 => 1,
LL | |         3 => {
LL | |             2
   | |             ^ expected (), found integer
LL | |         }
LL | |         _ => 2
LL | |     }
   | |     -- help: consider using a semicolon here
   | |_____|
   |       expected this to be `()`
   |
   = note: expected type `()`
              found type `{integer}
```

Fix #40799.
Diffstat (limited to 'src/test/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions