about summary refs log tree commit diff
path: root/src/rustllvm
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-03-07 08:15:19 +0100
committerGitHub <noreply@github.com>2020-03-07 08:15:19 +0100
commite8bb6c05ab455999ccfe10e178bc2ada9d450187 (patch)
tree3ab5e5734a1bb4a0794de59141b975ea13120b3d /src/rustllvm
parent2890b37b861247de3b8c6ba2ecbcd00048c728a1 (diff)
parent125159f30a7a97b0b4d4bc36b11846a3f6dd4a7b (diff)
downloadrust-e8bb6c05ab455999ccfe10e178bc2ada9d450187.tar.gz
rust-e8bb6c05ab455999ccfe10e178bc2ada9d450187.zip
Rollup merge of #67741 - estebank:point-at-pat-def, r=Centril
When encountering an Item in a pat context, point at the item def

```
error[E0308]: mismatched types
  --> $DIR/const-in-struct-pat.rs:8:17
   |
LL | struct foo;
   | ----------- `foo` defined here
...
LL |     let Thing { foo } = t;
   |                 ^^^ expected struct `std::string::String`, found struct `foo`
   |
   = note: `foo` is interpreted as a unit struct, not a new binding
help: you can bind the struct field to a different name
   |
LL |     let Thing { foo: other_foo } = t;
   |                 ^^^^^^^^^^^^^^
```
```
error[E0308]: mismatched types
  --> $DIR/const.rs:14:9
   |
LL | const FOO: Foo = Foo{bar: 5};
   | ----------------------------- constant defined here
...
LL |         FOO => {},
   |         ^^^
   |         |
   |         expected `&Foo`, found struct `Foo`
   |         `FOO` is interpreted as a constant, not a new binding
   |         help: use different name to introduce a new binding: `other_foo`
```

Fix #55631, fix #48062, cc #42876.
Diffstat (limited to 'src/rustllvm')
0 files changed, 0 insertions, 0 deletions