diff options
| author | est31 <MTest31@outlook.com> | 2022-02-15 05:58:25 +0100 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2022-02-16 22:43:39 +0100 |
| commit | 60f969a4f24c44f4ec763027bfbfe1747ae876b6 (patch) | |
| tree | d9295176131e87a872183451c85170d92c2eac2a /compiler/rustc_resolve/src | |
| parent | 3cfa4def7c87d571bd46d92fed608edf8fad236e (diff) | |
| download | rust-60f969a4f24c44f4ec763027bfbfe1747ae876b6.tar.gz rust-60f969a4f24c44f4ec763027bfbfe1747ae876b6.zip | |
Adopt let_else in even more places
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/late/diagnostics.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index d05f139e3bf..ddec4c3dda7 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -704,7 +704,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> { ) = &bounded_ty.kind { // use this to verify that ident is a type param. - let partial_res = if let Ok(Some(partial_res)) = self.resolve_qpath_anywhere( + let Ok(Some(partial_res)) = self.resolve_qpath_anywhere( bounded_ty.id, None, &Segment::from_path(path), @@ -712,9 +712,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> { span, true, CrateLint::No, - ) { - partial_res - } else { + ) else { return false; }; if !(matches!( @@ -731,7 +729,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> { if let ast::TyKind::Path(None, type_param_path) = &ty.peel_refs().kind { // Confirm that the `SelfTy` is a type parameter. - let partial_res = if let Ok(Some(partial_res)) = self.resolve_qpath_anywhere( + let Ok(Some(partial_res)) = self.resolve_qpath_anywhere( bounded_ty.id, None, &Segment::from_path(type_param_path), @@ -739,9 +737,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> { span, true, CrateLint::No, - ) { - partial_res - } else { + ) else { return false; }; if !(matches!( |
