rust/src/test
bors 2b5ddf36fd Auto merge of #86809 - DevinR528:reachable-pat, r=Nadrieril
Add non_exhaustive_omitted_patterns lint related to rfc-2008-non_exhaustive

Fixes: #84332

This PR adds `non_exhaustive_omitted_patterns`, an allow by default lint that is triggered when a `non_exhaustive` type is missing explicit patterns. The warning or deny attribute can be put above the wildcard `_` pattern on enums or on the expression for enums or structs. The lint is capable of warning about multiple types within the same pattern. This lint will not be triggered for `if let ..` patterns.

```rust
// crate A
#[non_exhaustive]
pub struct Foo {
    a: u8,
    b: usize,
}
#[non_exhaustive]
pub enum Bar {
    A(Foo),
    B,
}

// crate B
#[deny(non_exhaustive_omitted_patterns)] // here
match Bar::B {
    Bar::B => {}
    #[deny(non_exhaustive_omitted_patterns)] // or here
    _ => {}
}

#[warn(non_exhaustive_omitted_patterns)] // only here
let Foo { a, .. } = Foo::default();

#[deny(non_exhaustive_omitted_patterns)]
match Bar::B {
    // triggers for Bar::B, and Foo.b
    Bar::A(Foo { a, .. }) => {}
    // if the attribute was here only Bar::B would cause a warning
    _ => {}
}
```
2021-09-16 05:29:22 +00:00
..
assembly enum niche allocation grows toward zero if possible 2021-09-13 21:55:14 +02:00
auxiliary
codegen Add test for -Z panic-in-drop=abort 2021-09-11 16:13:30 +01:00
codegen-units
debuginfo Disable debuginfo test on Windows that fails in new cdb version. 2021-09-15 15:59:48 -07:00
incremental Rebase fallout. 2021-09-11 17:52:39 +02:00
mir-opt Auto merge of #88839 - nbdd0121:alignof, r=nagisa 2021-09-12 23:49:24 +00:00
pretty
run-make
run-make-fulldeps Rollup merge of #87320 - danakj:debug-compilation-dir, r=michaelwoerister 2021-09-15 14:56:56 -07:00
run-pass-valgrind
rustdoc Add test for primitive in "jump to definition" feature 2021-09-13 17:44:39 +02:00
rustdoc-gui Rollup merge of #88896 - GuillaumeGomez:flakyness, r=camelid 2021-09-13 21:20:43 +02:00
rustdoc-js
rustdoc-js-std Fix linkcheck issues 2021-09-12 02:30:24 +00:00
rustdoc-json
rustdoc-ui Auto merge of #73314 - GuillaumeGomez:display-warnings, r=jyn514 2021-09-14 16:05:44 +00:00
ui Auto merge of #86809 - DevinR528:reachable-pat, r=Nadrieril 2021-09-16 05:29:22 +00:00
ui-fulldeps
COMPILER_TESTS.md