Skip to content

Commit

Permalink
Remove librustc_infer crate re-exports.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Feb 16, 2020
1 parent bee6a5a commit 795673a
Show file tree
Hide file tree
Showing 61 changed files with 150 additions and 156 deletions.
4 changes: 2 additions & 2 deletions src/librustc_infer/infer/at.rs
Expand Up @@ -27,8 +27,8 @@

use super::*;

use crate::ty::relate::{Relate, TypeRelation};
use crate::ty::Const;
use rustc::ty::relate::{Relate, TypeRelation};
use rustc::ty::Const;

pub struct At<'a, 'tcx> {
pub infcx: &'a InferCtxt<'a, 'tcx>,
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_infer/infer/canonical/canonicalizer.rs
Expand Up @@ -10,10 +10,10 @@ use crate::infer::canonical::{
OriginalQueryValues,
};
use crate::infer::InferCtxt;
use crate::ty::flags::FlagComputation;
use crate::ty::fold::{TypeFoldable, TypeFolder};
use crate::ty::subst::GenericArg;
use crate::ty::{self, BoundVar, InferConst, List, Ty, TyCtxt, TypeFlags};
use rustc::ty::flags::FlagComputation;
use rustc::ty::fold::{TypeFoldable, TypeFolder};
use rustc::ty::subst::GenericArg;
use rustc::ty::{self, BoundVar, InferConst, List, Ty, TyCtxt, TypeFlags};
use std::sync::atomic::Ordering;

use rustc_data_structures::fx::FxHashMap;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_infer/infer/canonical/query_response.rs
Expand Up @@ -7,7 +7,6 @@
//!
//! [c]: https://rust-lang.github.io/rustc-guide/traits/canonicalization.html

use crate::arena::ArenaAllocatable;
use crate::infer::canonical::substitute::{substitute_value, CanonicalExt};
use crate::infer::canonical::{
Canonical, CanonicalVarValues, CanonicalizedQueryResponse, Certainty, OriginalQueryValues,
Expand All @@ -19,6 +18,7 @@ use crate::infer::{InferCtxt, InferOk, InferResult};
use crate::traits::query::{Fallible, NoSolution};
use crate::traits::TraitEngine;
use crate::traits::{Obligation, ObligationCause, PredicateObligation};
use rustc::arena::ArenaAllocatable;
use rustc::ty::fold::TypeFoldable;
use rustc::ty::subst::{GenericArg, GenericArgKind};
use rustc::ty::{self, BoundVar, Ty, TyCtxt};
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_infer/infer/canonical/substitute.rs
Expand Up @@ -7,9 +7,9 @@
//! [c]: https://rust-lang.github.io/rustc-guide/traits/canonicalization.html

use crate::infer::canonical::{Canonical, CanonicalVarValues};
use crate::ty::fold::TypeFoldable;
use crate::ty::subst::GenericArgKind;
use crate::ty::{self, TyCtxt};
use rustc::ty::fold::TypeFoldable;
use rustc::ty::subst::GenericArgKind;
use rustc::ty::{self, TyCtxt};

pub(super) trait CanonicalExt<'tcx, V> {
/// Instantiate the wrapped value, replacing each canonical value
Expand Down
10 changes: 5 additions & 5 deletions src/librustc_infer/infer/combine.rs
Expand Up @@ -33,12 +33,12 @@ use super::unify_key::{ConstVariableOrigin, ConstVariableOriginKind};
use super::{InferCtxt, MiscVariable, TypeTrace};

use crate::traits::{Obligation, PredicateObligations};
use crate::ty::error::TypeError;
use crate::ty::relate::{self, Relate, RelateResult, TypeRelation};
use crate::ty::subst::SubstsRef;
use crate::ty::{self, InferConst, Ty, TyCtxt};
use crate::ty::{IntType, UintType};

use rustc::ty::error::TypeError;
use rustc::ty::relate::{self, Relate, RelateResult, TypeRelation};
use rustc::ty::subst::SubstsRef;
use rustc::ty::{self, InferConst, Ty, TyCtxt};
use rustc::ty::{IntType, UintType};
use rustc_hir::def_id::DefId;
use rustc_span::{Span, DUMMY_SP};
use syntax::ast;
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_infer/infer/equate.rs
@@ -1,10 +1,10 @@
use super::combine::{CombineFields, RelationDir};
use super::Subtype;

use crate::ty::relate::{self, Relate, RelateResult, TypeRelation};
use crate::ty::subst::SubstsRef;
use crate::ty::TyVar;
use crate::ty::{self, Ty, TyCtxt};
use rustc::ty::relate::{self, Relate, RelateResult, TypeRelation};
use rustc::ty::subst::SubstsRef;
use rustc::ty::TyVar;
use rustc::ty::{self, Ty, TyCtxt};

use rustc_hir::def_id::DefId;

Expand Down
6 changes: 3 additions & 3 deletions src/librustc_infer/infer/error_reporting/need_type_info.rs
@@ -1,8 +1,8 @@
use crate::hir::map::Map;
use crate::infer::type_variable::TypeVariableOriginKind;
use crate::infer::InferCtxt;
use crate::ty::print::Print;
use crate::ty::{self, DefIdTree, Infer, Ty, TyVar};
use rustc::hir::map::Map;
use rustc::ty::print::Print;
use rustc::ty::{self, DefIdTree, Infer, Ty, TyVar};
use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Namespace};
Expand Down
Expand Up @@ -3,7 +3,7 @@

use crate::infer::error_reporting::nice_region_error::util::AnonymousParamInfo;
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::util::common::ErrorReported;
use rustc::util::common::ErrorReported;

use rustc_errors::struct_span_err;

Expand Down
@@ -1,7 +1,7 @@
use crate::hir::map::Map;
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::middle::resolve_lifetime as rl;
use crate::ty::{self, Region, TyCtxt};
use rustc::hir::map::Map;
use rustc::middle::resolve_lifetime as rl;
use rustc::ty::{self, Region, TyCtxt};
use rustc_hir as hir;
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc_hir::Node;
Expand Down
@@ -1,8 +1,8 @@
use crate::infer::lexical_region_resolve::RegionResolutionError;
use crate::infer::lexical_region_resolve::RegionResolutionError::*;
use crate::infer::InferCtxt;
use crate::ty::{self, TyCtxt};
use crate::util::common::ErrorReported;
use rustc::ty::{self, TyCtxt};
use rustc::util::common::ErrorReported;
use rustc_errors::DiagnosticBuilder;
use rustc_span::source_map::Span;

Expand Down
@@ -1,7 +1,7 @@
//! Error Reporting for Anonymous Region Lifetime Errors
//! where one region is named and the other is anonymous.
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::ty;
use rustc::ty;
use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
use rustc_hir::{FunctionRetTy, TyKind};

Expand Down
Expand Up @@ -4,8 +4,8 @@
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::infer::lexical_region_resolve::RegionResolutionError::SubSupConflict;
use crate::infer::SubregionOrigin;
use crate::ty::RegionKind;
use crate::util::common::ErrorReported;
use rustc::ty::RegionKind;
use rustc::util::common::ErrorReported;
use rustc_hir::{Expr, ExprKind::Closure, Node};

impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
Expand Down
Expand Up @@ -3,10 +3,10 @@ use crate::infer::lexical_region_resolve::RegionResolutionError;
use crate::infer::ValuePairs;
use crate::infer::{SubregionOrigin, TypeTrace};
use crate::traits::{ObligationCause, ObligationCauseCode};
use crate::ty::error::ExpectedFound;
use crate::ty::print::{FmtPrinter, Print, RegionHighlightMode};
use crate::ty::subst::SubstsRef;
use crate::ty::{self, TyCtxt};
use rustc::ty::error::ExpectedFound;
use rustc::ty::print::{FmtPrinter, Print, RegionHighlightMode};
use rustc::ty::subst::SubstsRef;
use rustc::ty::{self, TyCtxt};
use rustc_errors::DiagnosticBuilder;
use rustc_hir::def::Namespace;
use rustc_hir::def_id::DefId;
Expand Down
Expand Up @@ -3,8 +3,8 @@
use crate::infer::error_reporting::msg_span_from_free_region;
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::infer::lexical_region_resolve::RegionResolutionError;
use crate::ty::{BoundRegion, FreeRegion, RegionKind};
use crate::util::common::ErrorReported;
use rustc::ty::{BoundRegion, FreeRegion, RegionKind};
use rustc::util::common::ErrorReported;
use rustc_errors::Applicability;

impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
Expand Down
Expand Up @@ -4,8 +4,8 @@ use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::infer::lexical_region_resolve::RegionResolutionError;
use crate::infer::{Subtype, ValuePairs};
use crate::traits::ObligationCauseCode::CompareImplMethodObligation;
use crate::ty::Ty;
use crate::util::common::ErrorReported;
use rustc::ty::Ty;
use rustc::util::common::ErrorReported;
use rustc_span::Span;

impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
Expand Down
Expand Up @@ -2,7 +2,7 @@
//! anonymous regions.

use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::ty::{self, DefIdTree, Region, Ty};
use rustc::ty::{self, DefIdTree, Region, Ty};
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_span::Span;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_infer/infer/freshen.rs
Expand Up @@ -31,8 +31,8 @@
//! variable only once, and it does so as soon as it can, so it is reasonable to ask what the type
//! inferencer knows "so far".

use crate::ty::fold::TypeFolder;
use crate::ty::{self, Ty, TyCtxt, TypeFoldable};
use rustc::ty::fold::TypeFolder;
use rustc::ty::{self, Ty, TyCtxt, TypeFoldable};

use rustc_data_structures::fx::FxHashMap;

Expand Down
4 changes: 2 additions & 2 deletions src/librustc_infer/infer/fudge.rs
@@ -1,5 +1,5 @@
use crate::ty::fold::{TypeFoldable, TypeFolder};
use crate::ty::{self, ConstVid, FloatVid, IntVid, RegionVid, Ty, TyCtxt, TyVid};
use rustc::ty::fold::{TypeFoldable, TypeFolder};
use rustc::ty::{self, ConstVid, FloatVid, IntVid, RegionVid, Ty, TyCtxt, TyVid};

use super::type_variable::TypeVariableOrigin;
use super::InferCtxt;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_infer/infer/glb.rs
Expand Up @@ -4,8 +4,8 @@ use super::InferCtxt;
use super::Subtype;

use crate::traits::ObligationCause;
use crate::ty::relate::{Relate, RelateResult, TypeRelation};
use crate::ty::{self, Ty, TyCtxt};
use rustc::ty::relate::{Relate, RelateResult, TypeRelation};
use rustc::ty::{self, Ty, TyCtxt};

/// "Greatest lower bound" (common subtype)
pub struct Glb<'combine, 'infcx, 'tcx> {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_infer/infer/higher_ranked/mod.rs
Expand Up @@ -5,8 +5,8 @@ use super::combine::CombineFields;
use super::{HigherRankedType, InferCtxt, PlaceholderMap};

use crate::infer::CombinedSnapshot;
use crate::ty::relate::{Relate, RelateResult, TypeRelation};
use crate::ty::{self, Binder, TypeFoldable};
use rustc::ty::relate::{Relate, RelateResult, TypeRelation};
use rustc::ty::{self, Binder, TypeFoldable};

impl<'a, 'tcx> CombineFields<'a, 'tcx> {
pub fn higher_ranked_sub<T>(
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_infer/infer/lattice.rs
Expand Up @@ -23,9 +23,9 @@ use super::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
use super::InferCtxt;

use crate::traits::ObligationCause;
use crate::ty::relate::{RelateResult, TypeRelation};
use crate::ty::TyVar;
use crate::ty::{self, Ty};
use rustc::ty::relate::{RelateResult, TypeRelation};
use rustc::ty::TyVar;
use rustc::ty::{self, Ty};

pub trait LatticeDir<'f, 'tcx>: TypeRelation<'tcx> {
fn infcx(&self) -> &'f InferCtxt<'f, 'tcx>;
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_infer/infer/lexical_region_resolve/graphviz.rs
Expand Up @@ -11,9 +11,9 @@ use graphviz as dot;
use super::Constraint;
use crate::infer::region_constraints::RegionConstraintData;
use crate::infer::SubregionOrigin;
use crate::middle::free_region::RegionRelations;
use crate::middle::region;
use crate::ty;
use rustc::middle::free_region::RegionRelations;
use rustc::middle::region;
use rustc::ty;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_hir::def_id::DefIndex;

Expand Down
12 changes: 6 additions & 6 deletions src/librustc_infer/infer/lexical_region_resolve/mod.rs
Expand Up @@ -8,12 +8,12 @@ use crate::infer::region_constraints::VarInfos;
use crate::infer::region_constraints::VerifyBound;
use crate::infer::RegionVariableOrigin;
use crate::infer::SubregionOrigin;
use crate::middle::free_region::RegionRelations;
use crate::ty::fold::TypeFoldable;
use crate::ty::{self, Ty, TyCtxt};
use crate::ty::{ReEarlyBound, ReEmpty, ReErased, ReFree, ReStatic};
use crate::ty::{ReLateBound, RePlaceholder, ReScope, ReVar};
use crate::ty::{Region, RegionVid};
use rustc::middle::free_region::RegionRelations;
use rustc::ty::fold::TypeFoldable;
use rustc::ty::{self, Ty, TyCtxt};
use rustc::ty::{ReEarlyBound, ReEmpty, ReErased, ReFree, ReStatic};
use rustc::ty::{ReLateBound, RePlaceholder, ReScope, ReVar};
use rustc::ty::{Region, RegionVid};
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::graph::implementation::{
Direction, Graph, NodeIndex, INCOMING, OUTGOING,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_infer/infer/lub.rs
Expand Up @@ -4,8 +4,8 @@ use super::InferCtxt;
use super::Subtype;

use crate::traits::ObligationCause;
use crate::ty::relate::{Relate, RelateResult, TypeRelation};
use crate::ty::{self, Ty, TyCtxt};
use rustc::ty::relate::{Relate, RelateResult, TypeRelation};
use rustc::ty::{self, Ty, TyCtxt};

/// "Least upper bound" (common supertype)
pub struct Lub<'combine, 'infcx, 'tcx> {
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_infer/infer/mod.rs
Expand Up @@ -5,7 +5,7 @@ pub use self::LateBoundRegionConversionTime::*;
pub use self::RegionVariableOrigin::*;
pub use self::SubregionOrigin::*;
pub use self::ValuePairs::*;
pub use crate::ty::IntVarValue;
pub use rustc::ty::IntVarValue;

use crate::traits::{self, ObligationCause, PredicateObligations, TraitEngine};

Expand Down Expand Up @@ -650,8 +650,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
}

pub fn type_is_unconstrained_numeric(&'a self, ty: Ty<'_>) -> UnconstrainedNumeric {
use crate::ty::error::UnconstrainedNumeric::Neither;
use crate::ty::error::UnconstrainedNumeric::{UnconstrainedFloat, UnconstrainedInt};
use rustc::ty::error::UnconstrainedNumeric::Neither;
use rustc::ty::error::UnconstrainedNumeric::{UnconstrainedFloat, UnconstrainedInt};
match ty.kind {
ty::Infer(ty::IntVar(vid)) => {
if self.inner.borrow_mut().int_unification_table.probe_value(vid).is_some() {
Expand Down
10 changes: 5 additions & 5 deletions src/librustc_infer/infer/nll_relate/mod.rs
Expand Up @@ -24,11 +24,11 @@
use crate::infer::InferCtxt;
use crate::infer::{ConstVarValue, ConstVariableValue};
use crate::traits::DomainGoal;
use crate::ty::error::TypeError;
use crate::ty::fold::{TypeFoldable, TypeVisitor};
use crate::ty::relate::{self, Relate, RelateResult, TypeRelation};
use crate::ty::subst::GenericArg;
use crate::ty::{self, InferConst, Ty, TyCtxt};
use rustc::ty::error::TypeError;
use rustc::ty::fold::{TypeFoldable, TypeVisitor};
use rustc::ty::relate::{self, Relate, RelateResult, TypeRelation};
use rustc::ty::subst::GenericArg;
use rustc::ty::{self, InferConst, Ty, TyCtxt};
use rustc_data_structures::fx::FxHashMap;
use std::fmt::Debug;

Expand Down
10 changes: 5 additions & 5 deletions src/librustc_infer/infer/opaque_types/mod.rs
@@ -1,12 +1,12 @@
use crate::infer::error_reporting::{note_and_explain_free_region, note_and_explain_region};
use crate::infer::{self, InferCtxt, InferOk, TypeVariableOrigin, TypeVariableOriginKind};
use crate::middle::region;
use crate::traits::{self, PredicateObligation};
use crate::ty::fold::{BottomUpFolder, TypeFoldable, TypeFolder, TypeVisitor};
use crate::ty::free_region_map::FreeRegionRelations;
use crate::ty::subst::{GenericArg, GenericArgKind, InternalSubsts, SubstsRef};
use crate::ty::{self, GenericParamDefKind, Ty, TyCtxt};
use rustc::middle::region;
use rustc::session::config::nightly_options;
use rustc::ty::fold::{BottomUpFolder, TypeFoldable, TypeFolder, TypeVisitor};
use rustc::ty::free_region_map::FreeRegionRelations;
use rustc::ty::subst::{GenericArg, GenericArgKind, InternalSubsts, SubstsRef};
use rustc::ty::{self, GenericParamDefKind, Ty, TyCtxt};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lrc;
use rustc_errors::{struct_span_err, DiagnosticBuilder};
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_infer/infer/outlives/env.rs
@@ -1,7 +1,7 @@
use crate::infer::{GenericKind, InferCtxt};
use crate::traits::query::outlives_bounds::{self, OutlivesBound};
use crate::ty::free_region_map::FreeRegionMap;
use crate::ty::{self, Ty};
use rustc::ty::free_region_map::FreeRegionMap;
use rustc::ty::{self, Ty};
use rustc_data_structures::fx::FxHashMap;
use rustc_hir as hir;
use rustc_span::Span;
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_infer/infer/outlives/obligations.rs
Expand Up @@ -63,9 +63,9 @@ use crate::infer::outlives::env::RegionBoundPairs;
use crate::infer::outlives::verify::VerifyBoundCx;
use crate::infer::{self, GenericKind, InferCtxt, RegionObligation, SubregionOrigin, VerifyBound};
use crate::traits::ObligationCause;
use crate::ty::outlives::Component;
use crate::ty::subst::GenericArgKind;
use crate::ty::{self, Region, Ty, TyCtxt, TypeFoldable};
use rustc::ty::outlives::Component;
use rustc::ty::subst::GenericArgKind;
use rustc::ty::{self, Region, Ty, TyCtxt, TypeFoldable};

use rustc_data_structures::fx::FxHashMap;
use rustc_hir as hir;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_infer/infer/outlives/verify.rs
@@ -1,8 +1,8 @@
use crate::infer::outlives::env::RegionBoundPairs;
use crate::infer::{GenericKind, VerifyBound};
use crate::traits;
use crate::ty::subst::{InternalSubsts, Subst};
use crate::ty::{self, Ty, TyCtxt};
use rustc::ty::subst::{InternalSubsts, Subst};
use rustc::ty::{self, Ty, TyCtxt};
use rustc_data_structures::captures::Captures;
use rustc_hir::def_id::DefId;

Expand Down
4 changes: 2 additions & 2 deletions src/librustc_infer/infer/region_constraints/leak_check.rs
@@ -1,7 +1,7 @@
use super::*;
use crate::infer::{CombinedSnapshot, PlaceholderMap};
use crate::ty::error::TypeError;
use crate::ty::relate::RelateResult;
use rustc::ty::error::TypeError;
use rustc::ty::relate::RelateResult;

impl<'tcx> RegionConstraintCollector<'tcx> {
/// Searches region constraints created since `snapshot` that
Expand Down

0 comments on commit 795673a

Please sign in to comment.