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