Remap hidden types from typeck before storing them in the TypeckResult
This commit is contained in:
parent
9eb69e82e0
commit
70d39abbc2
4 changed files with 42 additions and 18 deletions
|
@ -536,7 +536,8 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
|
|||
let opaque_types =
|
||||
self.fcx.infcx.inner.borrow_mut().opaque_type_storage.take_opaque_types();
|
||||
for (opaque_type_key, decl) in opaque_types {
|
||||
let hidden_type = self.resolve(decl.hidden_type.ty, &decl.hidden_type.span);
|
||||
let hidden_type = self.resolve(decl.hidden_type, &decl.hidden_type.span);
|
||||
let opaque_type_key = self.resolve(opaque_type_key, &decl.hidden_type.span);
|
||||
|
||||
struct RecursionChecker {
|
||||
def_id: LocalDefId,
|
||||
|
@ -559,6 +560,14 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
|
|||
continue;
|
||||
}
|
||||
|
||||
let hidden_type = hidden_type
|
||||
.remap_generic_params_to_declaration_params(
|
||||
opaque_type_key,
|
||||
self.fcx.infcx.tcx,
|
||||
true,
|
||||
)
|
||||
.ty;
|
||||
|
||||
self.typeck_results.concrete_opaque_types.insert(opaque_type_key.def_id, hidden_type);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue