]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_middle/src/infer/mod.rs
Rollup merge of #102215 - alexcrichton:wasm-link-whole-archive, r=estebank
[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::{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, 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>,
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 }