From c6d23bdd328decdb0a0e98980af4c3b7aa13d9d6 Mon Sep 17 00:00:00 2001 From: yukang Date: Thu, 3 Nov 2022 09:42:34 +0800 Subject: [PATCH] code cleanup --- compiler/rustc_hir_typeck/src/cast.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_hir_typeck/src/cast.rs b/compiler/rustc_hir_typeck/src/cast.rs index cf7587ffa0e..4ff89511938 100644 --- a/compiler/rustc_hir_typeck/src/cast.rs +++ b/compiler/rustc_hir_typeck/src/cast.rs @@ -216,8 +216,7 @@ impl<'a, 'tcx> CastCheck<'tcx> { // inference is more completely known. match cast_ty.kind() { ty::Dynamic(_, _, ty::Dyn) | ty::Slice(..) => { - let reported = check.report_cast_to_unsized_type(fcx); - return Err(reported); + Err(check.report_cast_to_unsized_type(fcx)) } _ => Ok(check), }