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