Skip to content

Commit 36e3409

Browse files
Nadrierilvarkor
andcommitted
Apply suggestions from code review
Co-authored-by: varkor <github@varkor.com>
1 parent b9da2b3 commit 36e3409

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

compiler/rustc_mir_build/src/thir/pattern/_match.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ fn all_constructors<'p, 'tcx>(pcx: PatCtxt<'_, 'p, 'tcx>) -> Vec<Constructor<'tc
15881588
let is_declared_nonexhaustive = cx.is_foreign_non_exhaustive_enum(pcx.ty);
15891589

15901590
// If `exhaustive_patterns` is disabled and our scrutinee is an empty enum, we treat it
1591-
// as though it had an "unknown" constructor to avoid exposing its emptyness. The
1591+
// as though it had an "unknown" constructor to avoid exposing its emptiness. The
15921592
// exception is if the pattern is at the top level, because we want empty matches to be
15931593
// considered exhaustive.
15941594
let is_secretly_empty = def.variants.is_empty()
@@ -1640,7 +1640,7 @@ fn all_constructors<'p, 'tcx>(pcx: PatCtxt<'_, 'p, 'tcx>) -> Vec<Constructor<'tc
16401640
vec![make_range(0, max)]
16411641
}
16421642
// If `exhaustive_patterns` is disabled and our scrutinee is the never type, we cannot
1643-
// expose its emptyness. The exception is if the pattern is at the top level, because we
1643+
// expose its emptiness. The exception is if the pattern is at the top level, because we
16441644
// want empty matches to be considered exhaustive.
16451645
ty::Never if !cx.tcx.features().exhaustive_patterns && !pcx.is_top_level => {
16461646
vec![NonExhaustive]

src/test/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub enum EmptyNonExhaustiveEnum {}
2525
fn empty_non_exhaustive(x: EmptyNonExhaustiveEnum) {
2626
match x {}
2727
match x {
28-
_ => {}, //~ ERROR unreachable pattern
28+
_ => {} //~ ERROR unreachable pattern
2929
}
3030
}
3131

src/test/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error: unreachable pattern
22
--> $DIR/enum_same_crate_empty_match.rs:28:9
33
|
4-
LL | _ => {},
4+
LL | _ => {}
55
| ^
66
|
77
note: the lint level is defined here

0 commit comments

Comments
 (0)