Skip to content

Commit 9c07dad

Browse files
committed
Move infer::region_constraints::MemberConstraint to infer::types module.
1 parent 4e42f38 commit 9c07dad

File tree

3 files changed

+32
-24
lines changed

3 files changed

+32
-24
lines changed

src/librustc/infer/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ pub mod region_constraints;
6161
pub mod resolve;
6262
mod sub;
6363
pub mod type_variable;
64+
mod types;
6465
pub mod unify_key;
6566

6667
#[must_use]

src/librustc/infer/region_constraints/mod.rs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ use std::{cmp, fmt, mem};
2323

2424
mod leak_check;
2525

26+
pub use rustc::infer::types::MemberConstraint;
27+
2628
#[derive(Default)]
2729
pub struct RegionConstraintCollector<'tcx> {
2830
/// For each `RegionVid`, the corresponding `RegionVariableOrigin`.
@@ -145,30 +147,6 @@ impl Constraint<'_> {
145147
}
146148
}
147149

148-
/// Requires that `region` must be equal to one of the regions in `choice_regions`.
149-
/// We often denote this using the syntax:
150-
///
151-
/// ```
152-
/// R0 member of [O1..On]
153-
/// ```
154-
#[derive(Debug, Clone, HashStable, TypeFoldable, Lift)]
155-
pub struct MemberConstraint<'tcx> {
156-
/// The `DefId` of the opaque type causing this constraint: used for error reporting.
157-
pub opaque_type_def_id: DefId,
158-
159-
/// The span where the hidden type was instantiated.
160-
pub definition_span: Span,
161-
162-
/// The hidden type in which `member_region` appears: used for error reporting.
163-
pub hidden_ty: Ty<'tcx>,
164-
165-
/// The region `R0`.
166-
pub member_region: Region<'tcx>,
167-
168-
/// The options `O1..On`.
169-
pub choice_regions: Lrc<Vec<Region<'tcx>>>,
170-
}
171-
172150
/// `VerifyGenericBound(T, _, R, RS)`: the parameter type `T` (or
173151
/// associated type) must outlive the region `R`. `T` is known to
174152
/// outlive `RS`. Therefore, verify that `R <= RS[i]` for some

src/librustc/infer/types/mod.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
use crate::ty::Region;
2+
use crate::ty::Ty;
3+
use rustc_data_structures::sync::Lrc;
4+
use rustc_hir::def_id::DefId;
5+
use rustc_span::Span;
6+
7+
/// Requires that `region` must be equal to one of the regions in `choice_regions`.
8+
/// We often denote this using the syntax:
9+
///
10+
/// ```
11+
/// R0 member of [O1..On]
12+
/// ```
13+
#[derive(Debug, Clone, HashStable, TypeFoldable, Lift)]
14+
pub struct MemberConstraint<'tcx> {
15+
/// The `DefId` of the opaque type causing this constraint: used for error reporting.
16+
pub opaque_type_def_id: DefId,
17+
18+
/// The span where the hidden type was instantiated.
19+
pub definition_span: Span,
20+
21+
/// The hidden type in which `member_region` appears: used for error reporting.
22+
pub hidden_ty: Ty<'tcx>,
23+
24+
/// The region `R0`.
25+
pub member_region: Region<'tcx>,
26+
27+
/// The options `O1..On`.
28+
pub choice_regions: Lrc<Vec<Region<'tcx>>>,
29+
}

0 commit comments

Comments
 (0)