Skip to content

Commit 168d2a3

Browse files
committed
Fix issues in comments
1 parent b9ea715 commit 168d2a3

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/librustc_mir/hair/pattern/check_match.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,10 @@ impl<'a, 'tcx> MatchVisitor<'a, 'tcx> {
227227
let scrutinee_is_uninhabited = if self.tcx.features().exhaustive_patterns {
228228
self.tcx.is_ty_uninhabited_from(module, pat_ty)
229229
} else {
230-
if self.tcx.features().exhaustive_patterns {
231-
pat_ty.conservative_is_uninhabited()
232-
} else {
233-
match pat_ty.sty {
234-
ty::TyNever => true,
235-
ty::TyAdt(def, _) => def.variants.is_empty(),
236-
_ => false
237-
}
230+
match pat_ty.sty {
231+
ty::TyNever => true,
232+
ty::TyAdt(def, _) => def.variants.is_empty(),
233+
_ => false
238234
}
239235
};
240236
if !scrutinee_is_uninhabited {

src/librustc_typeck/check/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1065,8 +1065,8 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
10651065
ty::BindingMode::BindByValue(hir::Mutability::MutImmutable), true);
10661066

10671067
// If any of a function's parameters have a type that is uninhabited, then it
1068-
// may never be called (because its arguments cannot be constructed). Therefore,
1069-
// it must always diverge.
1068+
// it is not possible to call that function (because its arguments cannot be constructed).
1069+
// Therefore, it must always diverge.
10701070
if fcx.tcx.features().exhaustive_patterns {
10711071
if arg_ty.conservative_is_uninhabited() {
10721072
let mut diverges = Diverges::Always;

0 commit comments

Comments
 (0)