diff options
| author | est31 <MTest31@outlook.com> | 2022-02-19 00:48:49 +0100 | 
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2022-02-19 17:27:43 +0100 | 
| commit | 2ef8af66196f7cc270a0532ea989f2fc6bc6885d (patch) | |
| tree | e023e65e895d79575848f47b3d00129f9c5a9f0f /compiler/rustc_hir/src | |
| parent | b8c56fa8c30821129b0960180f528d4a1a4f9316 (diff) | |
| download | rust-2ef8af66196f7cc270a0532ea989f2fc6bc6885d.tar.gz rust-2ef8af66196f7cc270a0532ea989f2fc6bc6885d.zip | |
Adopt let else in more places
Diffstat (limited to 'compiler/rustc_hir/src')
| -rw-r--r-- | compiler/rustc_hir/src/hir.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_hir/src/lib.rs | 1 | 
2 files changed, 3 insertions, 3 deletions
| diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 0961d0131d0..255e661652d 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -635,9 +635,8 @@ pub struct WhereBoundPredicate<'hir> { impl<'hir> WhereBoundPredicate<'hir> { /// Returns `true` if `param_def_id` matches the `bounded_ty` of this predicate. pub fn is_param_bound(&self, param_def_id: DefId) -> bool { - let path = match self.bounded_ty.kind { - TyKind::Path(QPath::Resolved(None, path)) => path, - _ => return false, + let TyKind::Path(QPath::Resolved(None, path)) = self.bounded_ty.kind else { + return false; }; match path.res { Res::Def(DefKind::TyParam, def_id) diff --git a/compiler/rustc_hir/src/lib.rs b/compiler/rustc_hir/src/lib.rs index f1d62d03cbc..ba3eeb91fe9 100644 --- a/compiler/rustc_hir/src/lib.rs +++ b/compiler/rustc_hir/src/lib.rs @@ -5,6 +5,7 @@ #![feature(associated_type_defaults)] #![feature(const_btree_new)] #![feature(crate_visibility_modifier)] +#![feature(let_else)] #![feature(once_cell)] #![feature(min_specialization)] #![feature(never_type)] | 
