Move infer::region_constraints::MemberConstraint to infer::types module.
This commit is contained in:
parent
4e42f388c3
commit
9c07dad725
@ -61,6 +61,7 @@
|
|||||||
pub mod resolve;
|
pub mod resolve;
|
||||||
mod sub;
|
mod sub;
|
||||||
pub mod type_variable;
|
pub mod type_variable;
|
||||||
|
mod types;
|
||||||
pub mod unify_key;
|
pub mod unify_key;
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
mod leak_check;
|
mod leak_check;
|
||||||
|
|
||||||
|
pub use rustc::infer::types::MemberConstraint;
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct RegionConstraintCollector<'tcx> {
|
pub struct RegionConstraintCollector<'tcx> {
|
||||||
/// For each `RegionVid`, the corresponding `RegionVariableOrigin`.
|
/// For each `RegionVid`, the corresponding `RegionVariableOrigin`.
|
||||||
@ -145,30 +147,6 @@ pub fn involves_placeholders(&self) -> bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Requires that `region` must be equal to one of the regions in `choice_regions`.
|
|
||||||
/// We often denote this using the syntax:
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// R0 member of [O1..On]
|
|
||||||
/// ```
|
|
||||||
#[derive(Debug, Clone, HashStable, TypeFoldable, Lift)]
|
|
||||||
pub struct MemberConstraint<'tcx> {
|
|
||||||
/// The `DefId` of the opaque type causing this constraint: used for error reporting.
|
|
||||||
pub opaque_type_def_id: DefId,
|
|
||||||
|
|
||||||
/// The span where the hidden type was instantiated.
|
|
||||||
pub definition_span: Span,
|
|
||||||
|
|
||||||
/// The hidden type in which `member_region` appears: used for error reporting.
|
|
||||||
pub hidden_ty: Ty<'tcx>,
|
|
||||||
|
|
||||||
/// The region `R0`.
|
|
||||||
pub member_region: Region<'tcx>,
|
|
||||||
|
|
||||||
/// The options `O1..On`.
|
|
||||||
pub choice_regions: Lrc<Vec<Region<'tcx>>>,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// `VerifyGenericBound(T, _, R, RS)`: the parameter type `T` (or
|
/// `VerifyGenericBound(T, _, R, RS)`: the parameter type `T` (or
|
||||||
/// associated type) must outlive the region `R`. `T` is known to
|
/// associated type) must outlive the region `R`. `T` is known to
|
||||||
/// outlive `RS`. Therefore, verify that `R <= RS[i]` for some
|
/// outlive `RS`. Therefore, verify that `R <= RS[i]` for some
|
||||||
|
29
src/librustc/infer/types/mod.rs
Normal file
29
src/librustc/infer/types/mod.rs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
use crate::ty::Region;
|
||||||
|
use crate::ty::Ty;
|
||||||
|
use rustc_data_structures::sync::Lrc;
|
||||||
|
use rustc_hir::def_id::DefId;
|
||||||
|
use rustc_span::Span;
|
||||||
|
|
||||||
|
/// Requires that `region` must be equal to one of the regions in `choice_regions`.
|
||||||
|
/// We often denote this using the syntax:
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// R0 member of [O1..On]
|
||||||
|
/// ```
|
||||||
|
#[derive(Debug, Clone, HashStable, TypeFoldable, Lift)]
|
||||||
|
pub struct MemberConstraint<'tcx> {
|
||||||
|
/// The `DefId` of the opaque type causing this constraint: used for error reporting.
|
||||||
|
pub opaque_type_def_id: DefId,
|
||||||
|
|
||||||
|
/// The span where the hidden type was instantiated.
|
||||||
|
pub definition_span: Span,
|
||||||
|
|
||||||
|
/// The hidden type in which `member_region` appears: used for error reporting.
|
||||||
|
pub hidden_ty: Ty<'tcx>,
|
||||||
|
|
||||||
|
/// The region `R0`.
|
||||||
|
pub member_region: Region<'tcx>,
|
||||||
|
|
||||||
|
/// The options `O1..On`.
|
||||||
|
pub choice_regions: Lrc<Vec<Region<'tcx>>>,
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user