diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-03-07 08:15:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-07 08:15:19 +0100 |
| commit | e8bb6c05ab455999ccfe10e178bc2ada9d450187 (patch) | |
| tree | 3ab5e5734a1bb4a0794de59141b975ea13120b3d /src/rustllvm/RustWrapper.cpp | |
| parent | 2890b37b861247de3b8c6ba2ecbcd00048c728a1 (diff) | |
| parent | 125159f30a7a97b0b4d4bc36b11846a3f6dd4a7b (diff) | |
| download | rust-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/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
