about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorDavid Wood <david@davidtw.co>2020-09-29 16:52:43 +0100
committerDavid Wood <david@davidtw.co>2020-09-29 16:52:43 +0100
commit9ef68f53e1f882afb63f824a10ff33ccd2c4764b (patch)
tree3c3d10270a2852a73667aabd23e58a953cb8f7ad /compiler/rustc_codegen_llvm/src
parent26373fb4baa9c5b8a7a1e2821fcfa930a85d327d (diff)
downloadrust-9ef68f53e1f882afb63f824a10ff33ccd2c4764b.tar.gz
rust-9ef68f53e1f882afb63f824a10ff33ccd2c4764b.zip
resolve: improve "try using the enum's variant"
This commit improves the "try using the enum's variant" suggestion:

- Variants in suggestions would not result in more errors (e.g. use
  of a struct variant is only suggested if the suggestion can
  trivially construct that variant). Therefore, suggestions are only
  emitted for variants that have no fields (since the suggestion
  can't know what value fields would have).
- Suggestions include the syntax for constructing the variant. If a
  struct or tuple variant is suggested, then it is constructed in the
  suggestion - unless in pattern-matching or when arguments are already
  provided.
- A help message is added which mentions the variants which are no
  longer suggested.

Signed-off-by: David Wood <david@davidtw.co>
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions