Skip to content

Commit 3a09b8b

Browse files
committed
make all typing-mode conditional code an exhaustive match
1 parent 2facd34 commit 3a09b8b

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

compiler/rustc_type_ir/src/infer_ctxt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use crate::{self as ty, Interner, TyVid};
4141
feature = "nightly",
4242
derive(Encodable_NoContext, Decodable_NoContext, HashStable_NoContext)
4343
)]
44-
#[cfg_attr(not(bootstrap), rustc_must_match_exhaustively)]
44+
#[cfg_attr(feature = "nightly", cfg_attr(not(bootstrap), rustc_must_match_exhaustively))]
4545
pub enum TypingMode<I: Interner> {
4646
/// When checking whether impls overlap, we check whether any obligations
4747
/// are guaranteed to never hold when unifying the impls. This requires us

tests/ui-fulldeps/internal-lints/must_match_exhaustively.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,43 @@
55
#![feature(rustc_attrs)]
66
#![deny(rustc::rustc_must_match_exhaustively)]
77

8-
98
#[rustc_must_match_exhaustively]
109
#[derive(Copy, Clone)]
1110
enum Foo {
12-
A {field: u32},
11+
A { field: u32 },
1312
B,
1413
}
1514

1615
fn foo(f: Foo) {
1716
match f {
18-
Foo::A {..}=> {}
17+
Foo::A { .. } => {}
1918
Foo::B => {}
2019
}
2120

2221
match f {
2322
//~^ ERROR match is not exhaustive
24-
Foo::A {..} => {}
23+
Foo::A { .. } => {}
2524
_ => {}
2625
}
2726

2827
match f {
2928
//~^ ERROR match is not exhaustive
30-
Foo::A {..} => {}
29+
Foo::A { .. } => {}
3130
a => {}
3231
}
3332

3433
match &f {
3534
//~^ ERROR match is not exhaustive
36-
Foo::A {..} => {}
35+
Foo::A { .. } => {}
3736
a => {}
3837
}
3938

4039
match f {
41-
Foo::A {..} => {}
42-
a@Foo::B => {}
40+
Foo::A { .. } => {}
41+
a @ Foo::B => {}
4342
}
4443

45-
if let Foo::A {..} = f {}
44+
if let Foo::A { .. } = f {}
4645
//~^ ERROR match is not exhaustive
4746
}
4847

0 commit comments

Comments
 (0)