about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorZack M. Davis <code@zackmdavis.net>2021-01-16 15:41:52 -0800
committerZack M. Davis <code@zackmdavis.net>2021-01-16 16:01:36 -0800
commit14eb94fe7a3ca3a92d5d7e42744d105c0fc6d527 (patch)
tree6863952ae3418e1efb37b1aef143478f973b1609 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent63a83c5f55801b17b77adf690db397d17c706c48 (diff)
downloadrust-14eb94fe7a3ca3a92d5d7e42744d105c0fc6d527.tar.gz
rust-14eb94fe7a3ca3a92d5d7e42744d105c0fc6d527.zip
don't suggest erroneous trailing comma after `..`
In #76612, suggestions were added for missing fields in
patterns. However, the suggestions are being inserted just at the end
of the last field in the pattern—before any trailing comma after the
last field. This resulted in the "if you don't care about missing
fields" suggestion to recommend code with a trailing comma after the
field ellipsis (`..,`), which is actually not legal ("`..` must be at
the end and cannot have a trailing comma")!

Incidentally, the doc-comment on `error_unmentioned_fields` was using
`you_cant_use_this_field` as an example field name (presumably
copy-paste inherited from the description of Issue #76077), but
the present author found this confusing, because unmentioned fields
aren't necessarily unusable.

The suggested code in the diff this commit introduces to
`destructuring-assignment/struct_destructure_fail.stderr` doesn't
work, but it didn't work beforehand, either (because of the "found
reserved identifier `_`" thing), so you can't really call it a
regression; it could be fixed in a separate PR.

Resolves #78511.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions