From 816b9fc2d1d002824908c37ed043125c3031128d Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 28 Jul 2021 16:36:06 +0000 Subject: [PATCH] Remove Option only used as its Some variant --- .../src/borrow_check/type_check/mod.rs | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/compiler/rustc_mir/src/borrow_check/type_check/mod.rs b/compiler/rustc_mir/src/borrow_check/type_check/mod.rs index 3fb06cd2f5f..44e38a018a6 100644 --- a/compiler/rustc_mir/src/borrow_check/type_check/mod.rs +++ b/compiler/rustc_mir/src/borrow_check/type_check/mod.rs @@ -1344,10 +1344,7 @@ fn eq_opaque_type_and_type( debug!("eq_opaque_type_and_type: equated"); - Ok(InferOk { - value: Some(opaque_type_map), - obligations: obligations.into_vec(), - }) + Ok(InferOk { value: opaque_type_map, obligations: obligations.into_vec() }) }, || "input_output".to_string(), ), @@ -1361,25 +1358,23 @@ fn eq_opaque_type_and_type( // have to solve any bounds (e.g., `-> impl Iterator` needs to // prove that `T: Iterator` where `T` is the type we // instantiated it with). - if let Some(opaque_type_map) = opaque_type_map { - for (opaque_type_key, opaque_decl) in opaque_type_map { - self.fully_perform_op( - locations, - ConstraintCategory::OpaqueType, - CustomTypeOp::new( - |infcx| { - infcx.constrain_opaque_type( - opaque_type_key, - &opaque_decl, - GenerateMemberConstraints::IfNoStaticBound, - universal_region_relations, - ); - Ok(InferOk { value: (), obligations: vec![] }) - }, - || "opaque_type_map".to_string(), - ), - )?; - } + for (opaque_type_key, opaque_decl) in opaque_type_map { + self.fully_perform_op( + locations, + ConstraintCategory::OpaqueType, + CustomTypeOp::new( + |infcx| { + infcx.constrain_opaque_type( + opaque_type_key, + &opaque_decl, + GenerateMemberConstraints::IfNoStaticBound, + universal_region_relations, + ); + Ok(InferOk { value: (), obligations: vec![] }) + }, + || "opaque_type_map".to_string(), + ), + )?; } Ok(()) } -- 2.44.0