Remove ResolvedOpaqueTy and just use Ty, SubstsRef is already there
This commit is contained in:
parent
7f8cad2019
commit
7294f49d52
8 changed files with 40 additions and 69 deletions
|
@ -211,7 +211,7 @@ pub struct BorrowCheckResult<'tcx> {
|
||||||
/// All the opaque types that are restricted to concrete types
|
/// All the opaque types that are restricted to concrete types
|
||||||
/// by this function. Unlike the value in `TypeckResults`, this has
|
/// by this function. Unlike the value in `TypeckResults`, this has
|
||||||
/// unerased regions.
|
/// unerased regions.
|
||||||
pub concrete_opaque_types: VecMap<OpaqueTypeKey<'tcx>, ty::ResolvedOpaqueTy<'tcx>>,
|
pub concrete_opaque_types: VecMap<OpaqueTypeKey<'tcx>, Ty<'tcx>>,
|
||||||
pub closure_requirements: Option<ClosureRegionRequirements<'tcx>>,
|
pub closure_requirements: Option<ClosureRegionRequirements<'tcx>>,
|
||||||
pub used_mut_upvars: SmallVec<[Field; 8]>,
|
pub used_mut_upvars: SmallVec<[Field; 8]>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -288,17 +288,6 @@ impl<'a, V> LocalTableInContextMut<'a, V> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// All information necessary to validate and reveal an `impl Trait`.
|
|
||||||
#[derive(TyEncodable, TyDecodable, Debug, HashStable)]
|
|
||||||
pub struct ResolvedOpaqueTy<'tcx> {
|
|
||||||
/// The revealed type as seen by this function.
|
|
||||||
pub concrete_type: Ty<'tcx>,
|
|
||||||
/// Generic parameters on the opaque type as passed by this function.
|
|
||||||
/// For `type Foo<A, B> = impl Bar<A, B>; fn foo<T, U>() -> Foo<T, U> { .. }`
|
|
||||||
/// this is `[T, U]`, not `[A, B]`.
|
|
||||||
pub substs: SubstsRef<'tcx>,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Whenever a value may be live across a generator yield, the type of that value winds up in the
|
/// Whenever a value may be live across a generator yield, the type of that value winds up in the
|
||||||
/// `GeneratorInteriorTypeCause` struct. This struct adds additional information about such
|
/// `GeneratorInteriorTypeCause` struct. This struct adds additional information about such
|
||||||
/// captured types that can be useful for diagnostics. In particular, it stores the span that
|
/// captured types that can be useful for diagnostics. In particular, it stores the span that
|
||||||
|
@ -426,7 +415,7 @@ pub struct TypeckResults<'tcx> {
|
||||||
|
|
||||||
/// All the opaque types that are restricted to concrete types
|
/// All the opaque types that are restricted to concrete types
|
||||||
/// by this function.
|
/// by this function.
|
||||||
pub concrete_opaque_types: VecMap<OpaqueTypeKey<'tcx>, ResolvedOpaqueTy<'tcx>>,
|
pub concrete_opaque_types: VecMap<OpaqueTypeKey<'tcx>, Ty<'tcx>>,
|
||||||
|
|
||||||
/// Tracks the minimum captures required for a closure;
|
/// Tracks the minimum captures required for a closure;
|
||||||
/// see `MinCaptureInformationMap` for more details.
|
/// see `MinCaptureInformationMap` for more details.
|
||||||
|
|
|
@ -58,7 +58,7 @@ pub use self::consts::{Const, ConstInt, ConstKind, InferConst, ScalarInt, Uneval
|
||||||
pub use self::context::{
|
pub use self::context::{
|
||||||
tls, CanonicalUserType, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations,
|
tls, CanonicalUserType, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations,
|
||||||
CtxtInterners, DelaySpanBugEmitted, FreeRegionInfo, GeneratorInteriorTypeCause, GlobalCtxt,
|
CtxtInterners, DelaySpanBugEmitted, FreeRegionInfo, GeneratorInteriorTypeCause, GlobalCtxt,
|
||||||
Lift, ResolvedOpaqueTy, TyCtxt, TypeckResults, UserType, UserTypeAnnotationIndex,
|
Lift, TyCtxt, TypeckResults, UserType, UserTypeAnnotationIndex,
|
||||||
};
|
};
|
||||||
pub use self::instance::{Instance, InstanceDef};
|
pub use self::instance::{Instance, InstanceDef};
|
||||||
pub use self::list::List;
|
pub use self::list::List;
|
||||||
|
|
|
@ -8,7 +8,7 @@ use rustc_middle::mir::{
|
||||||
BasicBlock, Body, ClosureOutlivesSubject, ClosureRegionRequirements, LocalKind, Location,
|
BasicBlock, Body, ClosureOutlivesSubject, ClosureRegionRequirements, LocalKind, Location,
|
||||||
Promoted,
|
Promoted,
|
||||||
};
|
};
|
||||||
use rustc_middle::ty::{self, OpaqueTypeKey, RegionKind, RegionVid};
|
use rustc_middle::ty::{self, OpaqueTypeKey, RegionKind, RegionVid, Ty};
|
||||||
use rustc_span::symbol::sym;
|
use rustc_span::symbol::sym;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
@ -46,7 +46,7 @@ crate type PoloniusOutput = Output<RustcFacts>;
|
||||||
/// closure requirements to propagate, and any generated errors.
|
/// closure requirements to propagate, and any generated errors.
|
||||||
crate struct NllOutput<'tcx> {
|
crate struct NllOutput<'tcx> {
|
||||||
pub regioncx: RegionInferenceContext<'tcx>,
|
pub regioncx: RegionInferenceContext<'tcx>,
|
||||||
pub opaque_type_values: VecMap<OpaqueTypeKey<'tcx>, ty::ResolvedOpaqueTy<'tcx>>,
|
pub opaque_type_values: VecMap<OpaqueTypeKey<'tcx>, Ty<'tcx>>,
|
||||||
pub polonius_output: Option<Rc<PoloniusOutput>>,
|
pub polonius_output: Option<Rc<PoloniusOutput>>,
|
||||||
pub opt_closure_req: Option<ClosureRegionRequirements<'tcx>>,
|
pub opt_closure_req: Option<ClosureRegionRequirements<'tcx>>,
|
||||||
pub nll_errors: RegionErrors<'tcx>,
|
pub nll_errors: RegionErrors<'tcx>,
|
||||||
|
@ -366,7 +366,7 @@ pub(super) fn dump_annotation<'a, 'tcx>(
|
||||||
body: &Body<'tcx>,
|
body: &Body<'tcx>,
|
||||||
regioncx: &RegionInferenceContext<'tcx>,
|
regioncx: &RegionInferenceContext<'tcx>,
|
||||||
closure_region_requirements: &Option<ClosureRegionRequirements<'_>>,
|
closure_region_requirements: &Option<ClosureRegionRequirements<'_>>,
|
||||||
opaque_type_values: &VecMap<OpaqueTypeKey<'tcx>, ty::ResolvedOpaqueTy<'tcx>>,
|
opaque_type_values: &VecMap<OpaqueTypeKey<'tcx>, Ty<'tcx>>,
|
||||||
errors_buffer: &mut Vec<Diagnostic>,
|
errors_buffer: &mut Vec<Diagnostic>,
|
||||||
) {
|
) {
|
||||||
let tcx = infcx.tcx;
|
let tcx = infcx.tcx;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use rustc_data_structures::vec_map::VecMap;
|
use rustc_data_structures::vec_map::VecMap;
|
||||||
use rustc_infer::infer::InferCtxt;
|
use rustc_infer::infer::InferCtxt;
|
||||||
use rustc_middle::ty::{self, OpaqueTypeKey, TyCtxt, TypeFoldable};
|
use rustc_middle::ty::{self, OpaqueTypeKey, Ty, TyCtxt, TypeFoldable};
|
||||||
use rustc_span::Span;
|
use rustc_span::Span;
|
||||||
use rustc_trait_selection::opaque_types::InferCtxtExt;
|
use rustc_trait_selection::opaque_types::InferCtxtExt;
|
||||||
|
|
||||||
|
@ -50,12 +50,13 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||||
pub(in crate::borrow_check) fn infer_opaque_types(
|
pub(in crate::borrow_check) fn infer_opaque_types(
|
||||||
&self,
|
&self,
|
||||||
infcx: &InferCtxt<'_, 'tcx>,
|
infcx: &InferCtxt<'_, 'tcx>,
|
||||||
opaque_ty_decls: VecMap<OpaqueTypeKey<'tcx>, ty::ResolvedOpaqueTy<'tcx>>,
|
opaque_ty_decls: VecMap<OpaqueTypeKey<'tcx>, Ty<'tcx>>,
|
||||||
span: Span,
|
span: Span,
|
||||||
) -> VecMap<OpaqueTypeKey<'tcx>, ty::ResolvedOpaqueTy<'tcx>> {
|
) -> VecMap<OpaqueTypeKey<'tcx>, Ty<'tcx>> {
|
||||||
opaque_ty_decls
|
opaque_ty_decls
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|(opaque_type_key, ty::ResolvedOpaqueTy { concrete_type, substs })| {
|
.map(|(opaque_type_key, concrete_type)| {
|
||||||
|
let substs = opaque_type_key.substs;
|
||||||
debug!(?concrete_type, ?substs);
|
debug!(?concrete_type, ?substs);
|
||||||
|
|
||||||
let mut subst_regions = vec![self.universal_regions.fr_static];
|
let mut subst_regions = vec![self.universal_regions.fr_static];
|
||||||
|
@ -116,10 +117,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||||
universal_concrete_type,
|
universal_concrete_type,
|
||||||
span,
|
span,
|
||||||
);
|
);
|
||||||
(
|
(opaque_type_key, remapped_type)
|
||||||
opaque_type_key,
|
|
||||||
ty::ResolvedOpaqueTy { concrete_type: remapped_type, substs: universal_substs },
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
|
@ -819,7 +819,7 @@ struct TypeChecker<'a, 'tcx> {
|
||||||
reported_errors: FxHashSet<(Ty<'tcx>, Span)>,
|
reported_errors: FxHashSet<(Ty<'tcx>, Span)>,
|
||||||
borrowck_context: &'a mut BorrowCheckContext<'a, 'tcx>,
|
borrowck_context: &'a mut BorrowCheckContext<'a, 'tcx>,
|
||||||
universal_region_relations: &'a UniversalRegionRelations<'tcx>,
|
universal_region_relations: &'a UniversalRegionRelations<'tcx>,
|
||||||
opaque_type_values: VecMap<OpaqueTypeKey<'tcx>, ty::ResolvedOpaqueTy<'tcx>>,
|
opaque_type_values: VecMap<OpaqueTypeKey<'tcx>, Ty<'tcx>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct BorrowCheckContext<'a, 'tcx> {
|
struct BorrowCheckContext<'a, 'tcx> {
|
||||||
|
@ -834,7 +834,7 @@ struct BorrowCheckContext<'a, 'tcx> {
|
||||||
crate struct MirTypeckResults<'tcx> {
|
crate struct MirTypeckResults<'tcx> {
|
||||||
crate constraints: MirTypeckRegionConstraints<'tcx>,
|
crate constraints: MirTypeckRegionConstraints<'tcx>,
|
||||||
pub(in crate::borrow_check) universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
|
pub(in crate::borrow_check) universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
|
||||||
crate opaque_type_values: VecMap<OpaqueTypeKey<'tcx>, ty::ResolvedOpaqueTy<'tcx>>,
|
crate opaque_type_values: VecMap<OpaqueTypeKey<'tcx>, Ty<'tcx>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A collection of region constraints that must be satisfied for the
|
/// A collection of region constraints that must be satisfied for the
|
||||||
|
@ -1292,10 +1292,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
||||||
|
|
||||||
let opaque_type_key =
|
let opaque_type_key =
|
||||||
OpaqueTypeKey { def_id: opaque_def_id, substs: opaque_decl.substs };
|
OpaqueTypeKey { def_id: opaque_def_id, substs: opaque_decl.substs };
|
||||||
let opaque_defn_ty = match concrete_opaque_types
|
let concrete_ty = match concrete_opaque_types
|
||||||
.iter()
|
.iter()
|
||||||
.find(|(opaque_type_key, _)| opaque_type_key.def_id == opaque_def_id)
|
.find(|(opaque_type_key, _)| opaque_type_key.def_id == opaque_def_id)
|
||||||
.map(|(_, resolved_opaque_ty)| resolved_opaque_ty)
|
.map(|(_, concrete_ty)| concrete_ty)
|
||||||
{
|
{
|
||||||
None => {
|
None => {
|
||||||
if !concrete_is_opaque {
|
if !concrete_is_opaque {
|
||||||
|
@ -1309,17 +1309,16 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Some(opaque_defn_ty) => opaque_defn_ty,
|
Some(concrete_ty) => concrete_ty,
|
||||||
};
|
};
|
||||||
debug!("opaque_defn_ty = {:?}", opaque_defn_ty);
|
debug!("concrete_ty = {:?}", concrete_ty);
|
||||||
let subst_opaque_defn_ty =
|
let subst_opaque_defn_ty = concrete_ty.subst(tcx, opaque_decl.substs);
|
||||||
opaque_defn_ty.concrete_type.subst(tcx, opaque_decl.substs);
|
|
||||||
let renumbered_opaque_defn_ty =
|
let renumbered_opaque_defn_ty =
|
||||||
renumber::renumber_regions(infcx, subst_opaque_defn_ty);
|
renumber::renumber_regions(infcx, subst_opaque_defn_ty);
|
||||||
|
|
||||||
debug!(
|
debug!(
|
||||||
"eq_opaque_type_and_type: concrete_ty={:?}={:?} opaque_defn_ty={:?}",
|
"eq_opaque_type_and_type: concrete_ty={:?}={:?} opaque_defn_ty={:?}",
|
||||||
opaque_decl.concrete_ty, resolved_ty, renumbered_opaque_defn_ty,
|
concrete_ty, resolved_ty, renumbered_opaque_defn_ty,
|
||||||
);
|
);
|
||||||
|
|
||||||
if !concrete_is_opaque {
|
if !concrete_is_opaque {
|
||||||
|
@ -1330,13 +1329,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
||||||
.at(&ObligationCause::dummy(), param_env)
|
.at(&ObligationCause::dummy(), param_env)
|
||||||
.eq(opaque_decl.concrete_ty, renumbered_opaque_defn_ty)?,
|
.eq(opaque_decl.concrete_ty, renumbered_opaque_defn_ty)?,
|
||||||
);
|
);
|
||||||
opaque_type_values.insert(
|
opaque_type_values.insert(opaque_type_key, renumbered_opaque_defn_ty);
|
||||||
opaque_type_key,
|
|
||||||
ty::ResolvedOpaqueTy {
|
|
||||||
concrete_type: renumbered_opaque_defn_ty,
|
|
||||||
substs: opaque_decl.substs,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
// We're using an opaque `impl Trait` type without
|
// We're using an opaque `impl Trait` type without
|
||||||
// 'revealing' it. For example, code like this:
|
// 'revealing' it. For example, code like this:
|
||||||
|
|
|
@ -522,16 +522,13 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
|
||||||
// in some other location, or we'll end up emitting an error due
|
// in some other location, or we'll end up emitting an error due
|
||||||
// to the lack of defining usage
|
// to the lack of defining usage
|
||||||
if !skip_add {
|
if !skip_add {
|
||||||
let new = ty::ResolvedOpaqueTy {
|
|
||||||
concrete_type: definition_ty,
|
|
||||||
substs: opaque_defn.substs,
|
|
||||||
};
|
|
||||||
|
|
||||||
let opaque_type_key = OpaqueTypeKey { def_id, substs: opaque_defn.substs };
|
let opaque_type_key = OpaqueTypeKey { def_id, substs: opaque_defn.substs };
|
||||||
let old =
|
let old_concrete_ty = self
|
||||||
self.typeck_results.concrete_opaque_types.insert(opaque_type_key, new);
|
.typeck_results
|
||||||
if let Some(old) = old {
|
.concrete_opaque_types
|
||||||
if old.concrete_type != definition_ty || old.substs != opaque_defn.substs {
|
.insert(opaque_type_key, definition_ty);
|
||||||
|
if let Some(old_concrete_ty) = old_concrete_ty {
|
||||||
|
if old_concrete_ty != definition_ty {
|
||||||
span_bug!(
|
span_bug!(
|
||||||
span,
|
span,
|
||||||
"`visit_opaque_types` tried to write different types for the same \
|
"`visit_opaque_types` tried to write different types for the same \
|
||||||
|
@ -539,7 +536,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
|
||||||
def_id,
|
def_id,
|
||||||
definition_ty,
|
definition_ty,
|
||||||
opaque_defn,
|
opaque_defn,
|
||||||
old,
|
old_concrete_ty,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,9 +10,7 @@ use rustc_hir::{HirId, Node};
|
||||||
use rustc_middle::hir::map::Map;
|
use rustc_middle::hir::map::Map;
|
||||||
use rustc_middle::ty::subst::{GenericArgKind, InternalSubsts};
|
use rustc_middle::ty::subst::{GenericArgKind, InternalSubsts};
|
||||||
use rustc_middle::ty::util::IntTypeExt;
|
use rustc_middle::ty::util::IntTypeExt;
|
||||||
use rustc_middle::ty::{
|
use rustc_middle::ty::{self, DefIdTree, OpaqueTypeKey, Ty, TyCtxt, TypeFoldable};
|
||||||
self, DefIdTree, OpaqueTypeKey, ResolvedOpaqueTy, Ty, TyCtxt, TypeFoldable,
|
|
||||||
};
|
|
||||||
use rustc_span::symbol::Ident;
|
use rustc_span::symbol::Ident;
|
||||||
use rustc_span::{Span, DUMMY_SP};
|
use rustc_span::{Span, DUMMY_SP};
|
||||||
|
|
||||||
|
@ -353,7 +351,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
|
||||||
&tcx.mir_borrowck(owner.expect_local()).concrete_opaque_types,
|
&tcx.mir_borrowck(owner.expect_local()).concrete_opaque_types,
|
||||||
def_id.to_def_id(),
|
def_id.to_def_id(),
|
||||||
)
|
)
|
||||||
.map(|opaque| opaque.concrete_type)
|
.map(|&(_, concrete_ty)| concrete_ty)
|
||||||
.unwrap_or_else(|| {
|
.unwrap_or_else(|| {
|
||||||
tcx.sess.delay_span_bug(
|
tcx.sess.delay_span_bug(
|
||||||
DUMMY_SP,
|
DUMMY_SP,
|
||||||
|
@ -531,14 +529,13 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Use borrowck to get the type with unerased regions.
|
// Use borrowck to get the type with unerased regions.
|
||||||
let ty = find_concrete_ty_from_def_id(
|
let concrete_opaque_types = &self.tcx.mir_borrowck(def_id).concrete_opaque_types;
|
||||||
&self.tcx.mir_borrowck(def_id).concrete_opaque_types,
|
if let Some((opaque_type_key, concrete_type)) =
|
||||||
self.def_id,
|
find_concrete_ty_from_def_id(concrete_opaque_types, self.def_id)
|
||||||
);
|
{
|
||||||
if let Some(ty::ResolvedOpaqueTy { concrete_type, substs }) = ty {
|
|
||||||
debug!(
|
debug!(
|
||||||
"find_opaque_ty_constraints: found constraint for `{:?}` at `{:?}`: {:?}",
|
"find_opaque_ty_constraints: found constraint for `{:?}` at `{:?}`: {:?}",
|
||||||
self.def_id, def_id, ty,
|
self.def_id, def_id, concrete_type,
|
||||||
);
|
);
|
||||||
|
|
||||||
// FIXME(oli-obk): trace the actual span from inference to improve errors.
|
// FIXME(oli-obk): trace the actual span from inference to improve errors.
|
||||||
|
@ -549,7 +546,7 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {
|
||||||
// using `delay_span_bug`, just in case `wfcheck` slips up.
|
// using `delay_span_bug`, just in case `wfcheck` slips up.
|
||||||
let opaque_generics = self.tcx.generics_of(self.def_id);
|
let opaque_generics = self.tcx.generics_of(self.def_id);
|
||||||
let mut used_params: FxHashSet<_> = FxHashSet::default();
|
let mut used_params: FxHashSet<_> = FxHashSet::default();
|
||||||
for (i, arg) in substs.iter().enumerate() {
|
for (i, arg) in opaque_type_key.substs.iter().enumerate() {
|
||||||
let arg_is_param = match arg.unpack() {
|
let arg_is_param = match arg.unpack() {
|
||||||
GenericArgKind::Type(ty) => matches!(ty.kind(), ty::Param(_)),
|
GenericArgKind::Type(ty) => matches!(ty.kind(), ty::Param(_)),
|
||||||
GenericArgKind::Lifetime(lt) => {
|
GenericArgKind::Lifetime(lt) => {
|
||||||
|
@ -710,7 +707,7 @@ fn let_position_impl_trait_type(tcx: TyCtxt<'_>, opaque_ty_id: LocalDefId) -> Ty
|
||||||
let owner_typeck_results = tcx.typeck(scope_def_id);
|
let owner_typeck_results = tcx.typeck(scope_def_id);
|
||||||
let concrete_ty =
|
let concrete_ty =
|
||||||
find_concrete_ty_from_def_id(&owner_typeck_results.concrete_opaque_types, opaque_ty_def_id)
|
find_concrete_ty_from_def_id(&owner_typeck_results.concrete_opaque_types, opaque_ty_def_id)
|
||||||
.map(|opaque| opaque.concrete_type)
|
.map(|&(_, concrete_ty)| concrete_ty)
|
||||||
.unwrap_or_else(|| {
|
.unwrap_or_else(|| {
|
||||||
tcx.sess.delay_span_bug(
|
tcx.sess.delay_span_bug(
|
||||||
DUMMY_SP,
|
DUMMY_SP,
|
||||||
|
@ -808,11 +805,8 @@ fn check_feature_inherent_assoc_ty(tcx: TyCtxt<'_>, span: Span) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn find_concrete_ty_from_def_id<'tcx>(
|
fn find_concrete_ty_from_def_id<'tcx>(
|
||||||
concrete_opaque_types: &'tcx VecMap<OpaqueTypeKey<'tcx>, ResolvedOpaqueTy<'tcx>>,
|
concrete_opaque_types: &'tcx VecMap<OpaqueTypeKey<'tcx>, Ty<'tcx>>,
|
||||||
def_id: DefId,
|
def_id: DefId,
|
||||||
) -> Option<&'tcx ResolvedOpaqueTy<'tcx>> {
|
) -> Option<&'tcx (OpaqueTypeKey<'tcx>, Ty<'tcx>)> {
|
||||||
concrete_opaque_types
|
concrete_opaque_types.iter().find(|(opaque_type_key, _)| opaque_type_key.def_id == def_id)
|
||||||
.iter()
|
|
||||||
.find(|(opaque_type_key, _)| opaque_type_key.def_id == def_id)
|
|
||||||
.map(|(_, resolved_opaque_ty)| resolved_opaque_ty)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue