5 use crate::ty::{OpaqueTypeKey, Ty};
6 use rustc_data_structures::sync::Lrc;
9 /// Requires that `region` must be equal to one of the regions in `choice_regions`.
10 /// We often denote this using the syntax:
13 /// R0 member of [O1..On]
15 #[derive(Debug, Clone, HashStable, TypeFoldable, TypeVisitable, Lift)]
16 pub struct MemberConstraint<'tcx> {
17 /// The `DefId` and substs of the opaque type causing this constraint.
18 /// Used for error reporting.
19 pub key: OpaqueTypeKey<'tcx>,
21 /// The span where the hidden type was instantiated.
22 pub definition_span: Span,
24 /// The hidden type in which `member_region` appears: used for error reporting.
25 pub hidden_ty: Ty<'tcx>,
28 pub member_region: Region<'tcx>,
30 /// The options `O1..On`.
31 pub choice_regions: Lrc<Vec<Region<'tcx>>>,