From 1c57468840f708e52db9b1e59b536c4f4783e823 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Sun, 3 Dec 2017 12:03:44 -0500 Subject: [PATCH] move `type_check` out of `transform` and into the `nll` module --- src/librustc_mir/borrow_check/nll/mod.rs | 10 +++++----- .../borrow_check/nll/subtype_constraint_generation.rs | 6 +++--- .../nll/type_check/mod.rs} | 0 src/librustc_mir/transform/mod.rs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) rename src/librustc_mir/{transform/type_check.rs => borrow_check/nll/type_check/mod.rs} (100%) diff --git a/src/librustc_mir/borrow_check/nll/mod.rs b/src/librustc_mir/borrow_check/nll/mod.rs index 218142f7e2d..ffbb3d31917 100644 --- a/src/librustc_mir/borrow_check/nll/mod.rs +++ b/src/librustc_mir/borrow_check/nll/mod.rs @@ -16,7 +16,6 @@ use rustc::util::nodemap::FxHashMap; use std::collections::BTreeSet; use std::io; use transform::MirSource; -use transform::type_check; use util::liveness::{self, LivenessMode, LivenessResult, LocalSet}; use borrow_check::FlowAtLocation; use dataflow::MaybeInitializedLvals; @@ -27,14 +26,15 @@ use util::pretty::{self, ALIGN}; use self::mir_util::PassWhere; mod constraint_generation; +pub(crate) mod region_infer; +mod renumber; mod subtype_constraint_generation; +pub(crate) mod type_check; mod universal_regions; + +use self::region_infer::RegionInferenceContext; use self::universal_regions::UniversalRegions; -pub(crate) mod region_infer; -use self::region_infer::RegionInferenceContext; - -mod renumber; /// Rewrites the regions in the MIR to use NLL variables, also /// scraping out the set of universal regions (e.g., region parameters) diff --git a/src/librustc_mir/borrow_check/nll/subtype_constraint_generation.rs b/src/librustc_mir/borrow_check/nll/subtype_constraint_generation.rs index 73c40827c54..e42302761bf 100644 --- a/src/librustc_mir/borrow_check/nll/subtype_constraint_generation.rs +++ b/src/librustc_mir/borrow_check/nll/subtype_constraint_generation.rs @@ -14,11 +14,11 @@ use rustc::infer::region_constraints::RegionConstraintData; use rustc::infer::region_constraints::{Verify, VerifyBound}; use rustc::ty; use syntax::codemap::Span; -use transform::type_check::Locations; -use transform::type_check::MirTypeckRegionConstraints; -use transform::type_check::OutlivesSet; use super::region_infer::{TypeTest, RegionInferenceContext, RegionTest}; +use super::type_check::Locations; +use super::type_check::MirTypeckRegionConstraints; +use super::type_check::OutlivesSet; /// When the MIR type-checker executes, it validates all the types in /// the MIR, and in the process generates a set of constraints that diff --git a/src/librustc_mir/transform/type_check.rs b/src/librustc_mir/borrow_check/nll/type_check/mod.rs similarity index 100% rename from src/librustc_mir/transform/type_check.rs rename to src/librustc_mir/borrow_check/nll/type_check/mod.rs diff --git a/src/librustc_mir/transform/mod.rs b/src/librustc_mir/transform/mod.rs index fb9daf07c71..563405fccc9 100644 --- a/src/librustc_mir/transform/mod.rs +++ b/src/librustc_mir/transform/mod.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use borrow_check::nll::type_check; use build; use rustc::hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; use rustc::mir::{Mir, Promoted}; @@ -30,7 +31,6 @@ pub mod simplify_branches; pub mod simplify; pub mod erase_regions; pub mod no_landing_pads; -pub mod type_check; pub mod rustc_peek; pub mod elaborate_drops; pub mod add_call_guards;