diff options
Diffstat (limited to 'compiler/rustc_mir_build/src/build/matches/test.rs')
-rw-r--r-- | compiler/rustc_mir_build/src/build/matches/test.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler/rustc_mir_build/src/build/matches/test.rs b/compiler/rustc_mir_build/src/build/matches/test.rs index ad7a568a2..2de89f67d 100644 --- a/compiler/rustc_mir_build/src/build/matches/test.rs +++ b/compiler/rustc_mir_build/src/build/matches/test.rs @@ -563,14 +563,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let not_contained = self.values_not_contained_in_range(&*range, options).unwrap_or(false); - if not_contained { + not_contained.then(|| { // No switch values are contained in the pattern range, // so the pattern can be matched only if this test fails. - let otherwise = options.len(); - Some(otherwise) - } else { - None - } + options.len() + }) } (&TestKind::SwitchInt { .. }, _) => None, @@ -835,7 +832,7 @@ fn trait_method<'tcx>( tcx: TyCtxt<'tcx>, trait_def_id: DefId, method_name: Symbol, - substs: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>, + substs: impl IntoIterator<Item: Into<GenericArg<'tcx>>>, ) -> ConstantKind<'tcx> { // The unhygienic comparison here is acceptable because this is only // used on known traits. |