Skip to content

Commit d6412ce

Browse files
committed
meh
1 parent b4f96cb commit d6412ce

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,21 @@ pub(crate) fn handle_opaque_type_uses<'tcx>(
145145
scc_values: &scc_values,
146146
});
147147

148-
hidden_type.ty =
149-
infcx.infer_opaque_definition_from_instantiation(opaque_type_key, hidden_type);
150-
root_cx.add_concrete_opaque_type(opaque_type_key.def_id, hidden_type);
148+
let ty = infcx.infer_opaque_definition_from_instantiation(opaque_type_key, hidden_type);
149+
150+
// TODO this doesn't seem to help
151+
if !tcx.use_typing_mode_borrowck() {
152+
if let ty::Alias(ty::Opaque, alias_ty) = ty.kind()
153+
&& alias_ty.def_id == opaque_type_key.def_id.to_def_id()
154+
&& alias_ty.args == opaque_type_key.args
155+
{
156+
continue 'entry;
157+
}
158+
}
159+
root_cx.add_concrete_opaque_type(
160+
opaque_type_key.def_id,
161+
OpaqueHiddenType { span: hidden_type.span, ty },
162+
);
151163
}
152164

153165
if !unexpected_hidden_regions.is_empty() {

0 commit comments

Comments
 (0)