Uplift OpaqueTypeKey too, use it in response
This commit is contained in:
parent
4c2d888a50
commit
ff154c7122
7 changed files with 66 additions and 51 deletions
|
@ -14,7 +14,6 @@ use crate::solve::{
|
|||
inspect, response_no_constraints_raw, CanonicalResponse, QueryResult, Response,
|
||||
};
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_hir::def_id::LocalDefId;
|
||||
use rustc_index::IndexVec;
|
||||
use rustc_infer::infer::canonical::query_response::make_query_region_constraints;
|
||||
use rustc_infer::infer::canonical::{CanonicalExt, QueryRegionConstraints};
|
||||
|
@ -224,7 +223,6 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
|
|||
.filter(|(a, _)| {
|
||||
self.predefined_opaques_in_body.opaque_types.iter().all(|(pa, _)| pa != a)
|
||||
})
|
||||
.map(|(key, value)| (key.def_id, key.args, value))
|
||||
.collect(),
|
||||
normalization_nested_goals,
|
||||
}
|
||||
|
@ -393,14 +391,10 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
|
|||
}
|
||||
}
|
||||
|
||||
fn register_new_opaque_types(
|
||||
&mut self,
|
||||
opaque_types: &[(LocalDefId, ty::GenericArgsRef<'tcx>, Ty<'tcx>)],
|
||||
) {
|
||||
for &(def_id, args, ty) in opaque_types {
|
||||
fn register_new_opaque_types(&mut self, opaque_types: &[(ty::OpaqueTypeKey<'tcx>, Ty<'tcx>)]) {
|
||||
for &(key, ty) in opaque_types {
|
||||
let hidden_ty = ty::OpaqueHiddenType { ty, span: DUMMY_SP };
|
||||
self.infcx
|
||||
.inject_new_hidden_type_unchecked(ty::OpaqueTypeKey { def_id, args }, hidden_ty);
|
||||
self.infcx.inject_new_hidden_type_unchecked(key, hidden_ty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue