Skip to content

Commit 816b9fc

Browse files
committed
Remove Option only used as its Some variant
1 parent c091b5c commit 816b9fc

File tree

1 file changed

+18
-23
lines changed
  • compiler/rustc_mir/src/borrow_check/type_check

1 file changed

+18
-23
lines changed

compiler/rustc_mir/src/borrow_check/type_check/mod.rs

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,10 +1344,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
13441344

13451345
debug!("eq_opaque_type_and_type: equated");
13461346

1347-
Ok(InferOk {
1348-
value: Some(opaque_type_map),
1349-
obligations: obligations.into_vec(),
1350-
})
1347+
Ok(InferOk { value: opaque_type_map, obligations: obligations.into_vec() })
13511348
},
13521349
|| "input_output".to_string(),
13531350
),
@@ -1361,25 +1358,23 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
13611358
// have to solve any bounds (e.g., `-> impl Iterator` needs to
13621359
// prove that `T: Iterator` where `T` is the type we
13631360
// instantiated it with).
1364-
if let Some(opaque_type_map) = opaque_type_map {
1365-
for (opaque_type_key, opaque_decl) in opaque_type_map {
1366-
self.fully_perform_op(
1367-
locations,
1368-
ConstraintCategory::OpaqueType,
1369-
CustomTypeOp::new(
1370-
|infcx| {
1371-
infcx.constrain_opaque_type(
1372-
opaque_type_key,
1373-
&opaque_decl,
1374-
GenerateMemberConstraints::IfNoStaticBound,
1375-
universal_region_relations,
1376-
);
1377-
Ok(InferOk { value: (), obligations: vec![] })
1378-
},
1379-
|| "opaque_type_map".to_string(),
1380-
),
1381-
)?;
1382-
}
1361+
for (opaque_type_key, opaque_decl) in opaque_type_map {
1362+
self.fully_perform_op(
1363+
locations,
1364+
ConstraintCategory::OpaqueType,
1365+
CustomTypeOp::new(
1366+
|infcx| {
1367+
infcx.constrain_opaque_type(
1368+
opaque_type_key,
1369+
&opaque_decl,
1370+
GenerateMemberConstraints::IfNoStaticBound,
1371+
universal_region_relations,
1372+
);
1373+
Ok(InferOk { value: (), obligations: vec![] })
1374+
},
1375+
|| "opaque_type_map".to_string(),
1376+
),
1377+
)?;
13831378
}
13841379
Ok(())
13851380
}

0 commit comments

Comments
 (0)