Skip to content

Commit 8b17827

Browse files
committed
Remove unneeded get_hidden_type
1 parent 283ad66 commit 8b17827

File tree

1 file changed

+2
-8
lines changed
  • compiler/rustc_borrowck/src/region_infer/opaque_types

1 file changed

+2
-8
lines changed

compiler/rustc_borrowck/src/region_infer/opaque_types/mod.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,6 @@ fn add_hidden_type<'tcx>(
155155
}
156156
}
157157

158-
fn get_hidden_type<'tcx>(
159-
hidden_types: &DefinitionSiteHiddenTypes<'tcx>,
160-
def_id: LocalDefId,
161-
) -> Option<EarlyBinder<'tcx, OpaqueHiddenType<'tcx>>> {
162-
hidden_types.0.get(&def_id).map(|ty| EarlyBinder::bind(*ty))
163-
}
164-
165158
#[derive(Debug)]
166159
struct DefiningUse<'tcx> {
167160
/// The opaque type using non NLL vars. This uses the actual
@@ -501,7 +494,8 @@ pub(crate) fn apply_definition_site_hidden_types<'tcx>(
501494
let tcx = infcx.tcx;
502495
let mut errors = Vec::new();
503496
for &(key, hidden_type) in opaque_types {
504-
let Some(expected) = get_hidden_type(hidden_types, key.def_id) else {
497+
let Some(expected) = hidden_types.0.get(&key.def_id).map(|ty| EarlyBinder::bind(*ty))
498+
else {
505499
if !tcx.use_typing_mode_borrowck() {
506500
if let ty::Alias(ty::Opaque, alias_ty) = hidden_type.ty.kind()
507501
&& alias_ty.def_id == key.def_id.to_def_id()

0 commit comments

Comments
 (0)