rust/src
Hirochika Matsumoto 37196e3691 Suggest replacing an inexisting field for an unmentioned field
This PR adds a suggestion to replace an inexisting field for an
unmentioned field. Given the following code:
```rust
enum Foo {
    Bar { alpha: u8, bravo: u8, charlie: u8 },
}

fn foo(foo: Foo) {
    match foo {
        Foo::Bar {
            alpha,
            beta, // `bravo` miswritten as `beta` here.
            charlie,
        } => todo!(),
    }
}
```
the compiler now emits the error messages below.
```text
error[E0026]: variant `Foo::Bar` does not have a field named `beta`
 --> src/lib.rs:9:13
  |
9 |             beta, // `bravo` miswritten as `beta` here.
  |             ^^^^
  |             |
  |             variant `Foo::Bar` does not have this field
  |             help: `Foo::Bar` has a field named `bravo`: `bravo`
```

Note that this suggestion is available iff the number of inexisting
fields and unmentioned fields are both 1.
2021-09-13 21:16:05 +09:00
..
bootstrap explicitly link to external ena docs 2021-09-11 20:24:46 +02:00
build_helper rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
ci Rollup merge of #88699 - Mark-Simulacrum:fixes-cherry-picker, r=pietroalbini 2021-09-12 03:44:55 -07:00
doc Fix typo option -> options. 2021-09-10 00:36:35 -07:00
etc set the executable bit on pre-commit.sh 2021-08-11 15:06:33 -04:00
librustdoc Rollup merge of #88810 - camelid:cleanup-pt1, r=jyn514 2021-09-12 03:44:58 -07:00
llvm-project@86c7daa627 Update LLVM submodule 2021-09-11 00:15:38 +02:00
rustdoc-json-types rustdoc: Clean up handling of lifetime bounds 2021-09-02 14:27:59 -07:00
test Suggest replacing an inexisting field for an unmentioned field 2021-09-13 21:16:05 +09:00
tools Auto merge of #88517 - smoelius:without-patch-versions, r=flip1995 2021-09-13 02:45:18 +00:00
README.md
stage0.json Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
version Bump version to 1.57 2021-09-03 21:54:48 -04:00

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.