about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-10-12 22:13:26 +0530
committerGitHub <noreply@github.com>2022-10-12 22:13:26 +0530
commita9a5529eac770084cea00d786ad572e130112ddd (patch)
tree2d01aa77fd2bb4059fc276497f62b5d8086dd767 /compiler/rustc_codegen_gcc
parent117a98c5ceec27ef909bf95e62d079529ce24a82 (diff)
parentf9d3c8352660451cb14df831002eb1ec514e59e6 (diff)
downloadrust-a9a5529eac770084cea00d786ad572e130112ddd.tar.gz
rust-a9a5529eac770084cea00d786ad572e130112ddd.zip
Rollup merge of #102927 - compiler-errors:let, r=davidtwco
Fix `let` keyword removal suggestion in structs

(1.) Fixes a bug where, given this code:
```rust
struct Foo {
  let x: i32,
}
```

We were parsing the field name as `let` instead of `x`, which causes issues later on in the type-checking phase.

(2.) Also, suggestions for `let: i32` as a field regressed, displaying this extra `help:` which is removed by this PR

```
help: remove the let, the `let` keyword is not allowed in struct field definitions
  |
2 -     let: i32,
2 +     : i32,
```

(3.) Makes the suggestion text a bit more succinct, since we don't need to re-explain that `let` is not allowed in this position (since it's in a note that follows). This causes the suggestion to render inline as well.

cc `@gimbles,` this addresses a few nits I mentioned in your PR.
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions