Skip to content

Commit 5793896

Browse files
committed
Move InferVarInfo to ty_.rs
1 parent fa016bc commit 5793896

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

compiler/rustc_middle/src/ty/infer_var_info.rs

Lines changed: 0 additions & 12 deletions
This file was deleted.

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ mod erase_regions;
7272
mod generics;
7373
mod impl_trait_in_trait_data;
7474
mod impls_ty;
75-
mod infer_var_info;
7675
mod instance;
7776
mod list;
7877
mod opaque;
@@ -132,7 +131,6 @@ pub use self::diagnostics::*;
132131
pub use self::fold::{FallibleTypeFolder, TypeFoldable, TypeFolder, TypeSuperFoldable};
133132
pub use self::generics::*;
134133
pub use self::impl_trait_in_trait_data::ImplTraitInTraitData;
135-
pub use self::infer_var_info::InferVarInfo;
136134
pub use self::instance::{Instance, InstanceDef, ShortInstance, UnusedGenericParams};
137135
pub use self::list::List;
138136
pub use self::opaque::{OpaqueHiddenType, OpaqueTypeKey};
@@ -162,7 +160,7 @@ pub use self::subst::*;
162160
pub use self::symbol_name::SymbolName;
163161
pub use self::term::{ParamTerm, Term, TermKind};
164162
pub use self::trait_def::TraitDef;
165-
pub use self::ty_::{PlaceholderType, Ty};
163+
pub use self::ty_::{InferVarInfo, PlaceholderType, Ty};
166164
pub use self::typeck_results::{
167165
CanonicalUserType, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations,
168166
GeneratorDiagnosticData, GeneratorInteriorTypeCause, TypeckResults, UserType,

compiler/rustc_middle/src/ty/ty_.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,17 @@ pub struct Ty<'tcx>(pub(super) Interned<'tcx, WithCachedTypeInfo<TyKind<'tcx>>>)
88

99
pub type PlaceholderType = Placeholder<BoundTy>;
1010

11+
#[derive(Debug, Default, Copy, Clone)]
12+
pub struct InferVarInfo {
13+
/// This is true if we identified that this Ty (`?T`) is found in a `?T: Foo`
14+
/// obligation, where:
15+
///
16+
/// * `Foo` is not `Sized`
17+
/// * `(): Foo` may be satisfied
18+
pub self_in_trait: bool,
19+
/// This is true if we identified that this Ty (`?T`) is found in a `<_ as
20+
/// _>::AssocType = ?T`
21+
pub output: bool,
22+
}
23+
1124
// FIXME: move `Ty` inherent impls here (and possibly change structure wrt `sty` mod)

0 commit comments

Comments
 (0)