Auto merge of #70536 - Centril:rustc-middle, r=eddyb

Rename `librustc` to `librustc_middle`

Here we rename `librustc` to `librustc_middle`.

This crate is not nearly as large or central as it was previously and so it doesn't make much sense to give it such a central name as `librustc` ("the entry point to the compiler"). Moreover, there is already a `rustc` crate which is has the actual `fn main` of `rustc`, so having `librustc` is confusing relative to that.

r? @eddyb
This commit is contained in:
bors 2020-03-30 05:26:27 +00:00
commit 8926bb497d
602 changed files with 1812 additions and 1782 deletions

View File

@ -3132,39 +3132,6 @@ dependencies = [
"rustc-workspace-hack",
]
[[package]]
name = "rustc"
version = "0.0.0"
dependencies = [
"arena",
"backtrace",
"bitflags",
"byteorder",
"jobserver",
"log",
"measureme",
"parking_lot 0.10.0",
"polonius-engine",
"rustc-rayon",
"rustc-rayon-core",
"rustc_apfloat",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
"rustc_errors",
"rustc_feature",
"rustc_hir",
"rustc_index",
"rustc_macros",
"rustc_query_system",
"rustc_session",
"rustc_span",
"rustc_target",
"scoped-tls",
"serialize",
"smallvec 1.0.0",
]
[[package]]
name = "rustc-ap-arena"
version = "642.0.0"
@ -3603,7 +3570,6 @@ dependencies = [
"libc",
"log",
"measureme",
"rustc",
"rustc-demangle",
"rustc_ast",
"rustc_attr",
@ -3616,6 +3582,7 @@ dependencies = [
"rustc_incremental",
"rustc_index",
"rustc_llvm",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -3634,7 +3601,6 @@ dependencies = [
"log",
"memmap",
"num_cpus",
"rustc",
"rustc_apfloat",
"rustc_ast",
"rustc_attr",
@ -3645,6 +3611,7 @@ dependencies = [
"rustc_incremental",
"rustc_index",
"rustc_metadata",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_symbol_mangling",
@ -3685,7 +3652,6 @@ dependencies = [
"env_logger 0.7.1",
"lazy_static 1.4.0",
"log",
"rustc",
"rustc_ast",
"rustc_ast_pretty",
"rustc_codegen_ssa",
@ -3698,6 +3664,7 @@ dependencies = [
"rustc_interface",
"rustc_lint",
"rustc_metadata",
"rustc_middle",
"rustc_mir",
"rustc_parse",
"rustc_plugin_impl",
@ -3797,11 +3764,11 @@ dependencies = [
"graphviz",
"log",
"rand 0.7.3",
"rustc",
"rustc_ast",
"rustc_data_structures",
"rustc_fs_util",
"rustc_hir",
"rustc_middle",
"rustc_session",
"rustc_span",
"serialize",
@ -3821,13 +3788,13 @@ version = "0.0.0"
dependencies = [
"graphviz",
"log",
"rustc",
"rustc_ast",
"rustc_data_structures",
"rustc_errors",
"rustc_hir",
"rustc_index",
"rustc_macros",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -3840,7 +3807,6 @@ version = "0.0.0"
dependencies = [
"log",
"once_cell",
"rustc",
"rustc-rayon",
"rustc_ast",
"rustc_ast_lowering",
@ -3857,6 +3823,7 @@ dependencies = [
"rustc_infer",
"rustc_lint",
"rustc_metadata",
"rustc_middle",
"rustc_mir",
"rustc_mir_build",
"rustc_parse",
@ -3890,7 +3857,6 @@ name = "rustc_lint"
version = "0.0.0"
dependencies = [
"log",
"rustc",
"rustc_ast",
"rustc_ast_pretty",
"rustc_attr",
@ -3900,6 +3866,7 @@ dependencies = [
"rustc_hir",
"rustc_index",
"rustc_infer",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -3933,7 +3900,6 @@ dependencies = [
"flate2",
"log",
"memmap",
"rustc",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
@ -3942,6 +3908,7 @@ dependencies = [
"rustc_hir",
"rustc_hir_pretty",
"rustc_index",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -3951,6 +3918,39 @@ dependencies = [
"winapi 0.3.8",
]
[[package]]
name = "rustc_middle"
version = "0.0.0"
dependencies = [
"arena",
"backtrace",
"bitflags",
"byteorder",
"jobserver",
"log",
"measureme",
"parking_lot 0.10.0",
"polonius-engine",
"rustc-rayon",
"rustc-rayon-core",
"rustc_apfloat",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
"rustc_errors",
"rustc_feature",
"rustc_hir",
"rustc_index",
"rustc_macros",
"rustc_query_system",
"rustc_session",
"rustc_span",
"rustc_target",
"scoped-tls",
"serialize",
"smallvec 1.0.0",
]
[[package]]
name = "rustc_mir"
version = "0.0.0"
@ -3961,7 +3961,6 @@ dependencies = [
"log",
"log_settings",
"polonius-engine",
"rustc",
"rustc_apfloat",
"rustc_ast",
"rustc_ast_pretty",
@ -3973,6 +3972,7 @@ dependencies = [
"rustc_infer",
"rustc_lexer",
"rustc_macros",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -3987,7 +3987,6 @@ version = "0.0.0"
dependencies = [
"arena",
"log",
"rustc",
"rustc_apfloat",
"rustc_ast",
"rustc_attr",
@ -3997,6 +3996,7 @@ dependencies = [
"rustc_index",
"rustc_infer",
"rustc_macros",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -4028,7 +4028,6 @@ name = "rustc_passes"
version = "0.0.0"
dependencies = [
"log",
"rustc",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
@ -4037,6 +4036,7 @@ dependencies = [
"rustc_hir",
"rustc_index",
"rustc_infer",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -4047,12 +4047,12 @@ dependencies = [
name = "rustc_plugin_impl"
version = "0.0.0"
dependencies = [
"rustc",
"rustc_ast",
"rustc_errors",
"rustc_hir",
"rustc_lint",
"rustc_metadata",
"rustc_middle",
"rustc_session",
"rustc_span",
]
@ -4062,12 +4062,12 @@ name = "rustc_privacy"
version = "0.0.0"
dependencies = [
"log",
"rustc",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
"rustc_errors",
"rustc_hir",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_typeck",
@ -4096,7 +4096,6 @@ dependencies = [
"arena",
"bitflags",
"log",
"rustc",
"rustc_ast",
"rustc_ast_lowering",
"rustc_ast_pretty",
@ -4107,6 +4106,7 @@ dependencies = [
"rustc_feature",
"rustc_hir",
"rustc_metadata",
"rustc_middle",
"rustc_session",
"rustc_span",
"smallvec 1.0.0",
@ -4119,12 +4119,12 @@ dependencies = [
"log",
"rls-data",
"rls-span",
"rustc",
"rustc_ast",
"rustc_ast_pretty",
"rustc_data_structures",
"rustc_hir",
"rustc_hir_pretty",
"rustc_middle",
"rustc_parse",
"rustc_session",
"rustc_span",
@ -4169,12 +4169,12 @@ version = "0.0.0"
dependencies = [
"log",
"punycode",
"rustc",
"rustc-demangle",
"rustc_ast",
"rustc_data_structures",
"rustc_hir",
"rustc_metadata",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -4209,7 +4209,6 @@ version = "0.0.0"
dependencies = [
"fmt_macros",
"log",
"rustc",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
@ -4218,6 +4217,7 @@ dependencies = [
"rustc_index",
"rustc_infer",
"rustc_macros",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -4229,12 +4229,12 @@ name = "rustc_traits"
version = "0.0.0"
dependencies = [
"log",
"rustc",
"rustc_ast",
"rustc_data_structures",
"rustc_hir",
"rustc_infer",
"rustc_macros",
"rustc_middle",
"rustc_span",
"rustc_target",
"rustc_trait_selection",
@ -4246,10 +4246,10 @@ name = "rustc_ty"
version = "0.0.0"
dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_hir",
"rustc_infer",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
@ -4262,7 +4262,6 @@ version = "0.0.0"
dependencies = [
"arena",
"log",
"rustc",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
@ -4270,6 +4269,7 @@ dependencies = [
"rustc_hir",
"rustc_index",
"rustc_infer",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",

View File

@ -169,7 +169,7 @@ pub struct AssertParamIsCopy<T: Copy + ?Sized> {
/// Implementations of `Clone` for primitive types.
///
/// Implementations that cannot be described in Rust
/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc.
/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc_middle.
mod impls {
use super::Clone;

View File

@ -759,7 +759,7 @@ impl<T: ?Sized> Unpin for *mut T {}
/// Implementations of `Copy` for primitive types.
///
/// Implementations that cannot be described in Rust
/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc.
/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc_middle.
mod copy_impls {
use super::Copy;

View File

@ -6,7 +6,7 @@
//! They can be used as targets of transmutes in unsafe code for manipulating
//! the raw representations directly.
//!
//! Their definition should always match the ABI defined in `rustc::back::abi`.
//! Their definition should always match the ABI defined in `rustc_target::abi`.
/// The representation of a trait object like `&SomeTrait`.
///

View File

@ -1,132 +0,0 @@
/// This declares a list of types which can be allocated by `Arena`.
///
/// The `few` modifier will cause allocation to use the shared arena and recording the destructor.
/// This is faster and more memory efficient if there's only a few allocations of the type.
/// Leaving `few` out will cause the type to get its own dedicated `TypedArena` which is
/// faster and more memory efficient if there is lots of allocations.
///
/// Specifying the `decode` modifier will add decode impls for &T and &[T] where T is the type
/// listed. These impls will appear in the implement_ty_decoder! macro.
#[macro_export]
macro_rules! arena_types {
($macro:path, $args:tt, $tcx:lifetime) => (
$macro!($args, [
[] layouts: rustc::ty::layout::Layout,
[] generics: rustc::ty::Generics,
[] trait_def: rustc::ty::TraitDef,
[] adt_def: rustc::ty::AdtDef,
[] steal_mir: rustc::ty::steal::Steal<rustc::mir::BodyAndCache<$tcx>>,
[] mir: rustc::mir::BodyAndCache<$tcx>,
[] steal_promoted: rustc::ty::steal::Steal<
rustc_index::vec::IndexVec<
rustc::mir::Promoted,
rustc::mir::BodyAndCache<$tcx>
>
>,
[] promoted: rustc_index::vec::IndexVec<
rustc::mir::Promoted,
rustc::mir::BodyAndCache<$tcx>
>,
[decode] tables: rustc::ty::TypeckTables<$tcx>,
[decode] borrowck_result: rustc::mir::BorrowCheckResult<$tcx>,
[] const_allocs: rustc::mir::interpret::Allocation,
[] vtable_method: Option<(
rustc_hir::def_id::DefId,
rustc::ty::subst::SubstsRef<$tcx>
)>,
[few, decode] mir_keys: rustc_hir::def_id::DefIdSet,
[decode] specialization_graph: rustc::traits::specialization_graph::Graph,
[] region_scope_tree: rustc::middle::region::ScopeTree,
[] item_local_set: rustc_hir::ItemLocalSet,
[decode] mir_const_qualif: rustc_index::bit_set::BitSet<rustc::mir::Local>,
[] trait_impls_of: rustc::ty::trait_def::TraitImpls,
[] associated_items: rustc::ty::AssociatedItems,
[] dropck_outlives:
rustc::infer::canonical::Canonical<'tcx,
rustc::infer::canonical::QueryResponse<'tcx,
rustc::traits::query::DropckOutlivesResult<'tcx>
>
>,
[] normalize_projection_ty:
rustc::infer::canonical::Canonical<'tcx,
rustc::infer::canonical::QueryResponse<'tcx,
rustc::traits::query::NormalizationResult<'tcx>
>
>,
[] implied_outlives_bounds:
rustc::infer::canonical::Canonical<'tcx,
rustc::infer::canonical::QueryResponse<'tcx,
Vec<rustc::traits::query::OutlivesBound<'tcx>>
>
>,
[] type_op_subtype:
rustc::infer::canonical::Canonical<'tcx,
rustc::infer::canonical::QueryResponse<'tcx, ()>
>,
[] type_op_normalize_poly_fn_sig:
rustc::infer::canonical::Canonical<'tcx,
rustc::infer::canonical::QueryResponse<'tcx, rustc::ty::PolyFnSig<'tcx>>
>,
[] type_op_normalize_fn_sig:
rustc::infer::canonical::Canonical<'tcx,
rustc::infer::canonical::QueryResponse<'tcx, rustc::ty::FnSig<'tcx>>
>,
[] type_op_normalize_predicate:
rustc::infer::canonical::Canonical<'tcx,
rustc::infer::canonical::QueryResponse<'tcx, rustc::ty::Predicate<'tcx>>
>,
[] type_op_normalize_ty:
rustc::infer::canonical::Canonical<'tcx,
rustc::infer::canonical::QueryResponse<'tcx, rustc::ty::Ty<'tcx>>
>,
[few] crate_inherent_impls: rustc::ty::CrateInherentImpls,
[few] upstream_monomorphizations:
rustc_hir::def_id::DefIdMap<
rustc_data_structures::fx::FxHashMap<
rustc::ty::subst::SubstsRef<'tcx>,
rustc_hir::def_id::CrateNum
>
>,
[few] diagnostic_items: rustc_data_structures::fx::FxHashMap<
rustc_span::symbol::Symbol,
rustc_hir::def_id::DefId,
>,
[few] resolve_lifetimes: rustc::middle::resolve_lifetime::ResolveLifetimes,
[few] lint_levels: rustc::lint::LintLevelMap,
[few] stability_index: rustc::middle::stability::Index<'tcx>,
[few] features: rustc_feature::Features,
[few] all_traits: Vec<rustc_hir::def_id::DefId>,
[few] privacy_access_levels: rustc::middle::privacy::AccessLevels,
[few] target_features_whitelist: rustc_data_structures::fx::FxHashMap<
String,
Option<rustc_span::symbol::Symbol>
>,
[few] wasm_import_module_map: rustc_data_structures::fx::FxHashMap<
rustc_hir::def_id::DefId,
String
>,
[few] get_lib_features: rustc::middle::lib_features::LibFeatures,
[few] defined_lib_features: rustc::middle::lang_items::LanguageItems,
[few] visible_parent_map: rustc_hir::def_id::DefIdMap<rustc_hir::def_id::DefId>,
[few] foreign_module: rustc::middle::cstore::ForeignModule,
[few] foreign_modules: Vec<rustc::middle::cstore::ForeignModule>,
[few] reachable_non_generics: rustc_hir::def_id::DefIdMap<
rustc::middle::exported_symbols::SymbolExportLevel
>,
[few] crate_variances: rustc::ty::CrateVariancesMap<'tcx>,
[few] inferred_outlives_crate: rustc::ty::CratePredicatesMap<'tcx>,
[] upvars: rustc_data_structures::fx::FxIndexMap<rustc_hir::HirId, rustc_hir::Upvar>,
// Interned types
[] tys: rustc::ty::TyS<$tcx>,
// HIR query types
[few] indexed_hir: rustc::hir::map::IndexedHir<$tcx>,
[few] hir_definitions: rustc_hir::definitions::Definitions,
[] hir_owner: rustc::hir::Owner<$tcx>,
[] hir_owner_nodes: rustc::hir::OwnerNodes<$tcx>,
], $tcx);
)
}
arena_types!(arena::declare_arena, [], 'tcx);

View File

@ -10,7 +10,7 @@ pub enum EntryPointType {
OtherMain, // Not an entry point, but some other function named main
}
// Beware, this is duplicated in librustc/middle/entry.rs, make sure to keep
// Beware, this is duplicated in librustc_middle/middle/entry.rs, make sure to keep
// them in sync.
pub fn entry_point_type(item: &Item, depth: usize) -> EntryPointType {
match item.kind {

View File

@ -1,4 +1,4 @@
//! Definitions shared by macros / syntax extensions and e.g. librustc.
//! Definitions shared by macros / syntax extensions and e.g. librustc_middle.
use crate::ast::Attribute;
use rustc_span::symbol::sym;

View File

@ -54,7 +54,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
/// Requirements for a `StableHashingContext` to be used in this crate.
/// This is a hack to allow using the `HashStable_Generic` derive macro
/// instead of implementing everything in librustc.
/// instead of implementing everything in librustc_middle.
pub trait HashStableContext: rustc_span::HashStableContext {
fn hash_attr(&mut self, _: &ast::Attribute, hasher: &mut StableHasher);
}

View File

@ -97,7 +97,7 @@ struct LoweringContext<'a, 'hir: 'a> {
/// HACK(Centril): there is a cyclic dependency between the parser and lowering
/// if we don't have this function pointer. To avoid that dependency so that
/// librustc is independent of the parser, we use dynamic dispatch here.
/// librustc_middle is independent of the parser, we use dynamic dispatch here.
nt_to_tokenstream: NtToTokenstream,
/// Used to allocate HIR nodes

View File

@ -870,7 +870,7 @@ pub fn find_repr_attrs(sess: &ParseSess, attr: &Attribute) -> Vec<ReprAttr> {
let parse_alignment = |node: &ast::LitKind| -> Result<u32, &'static str> {
if let ast::LitKind::Int(literal, ast::LitIntType::Unsuffixed) = node {
if literal.is_power_of_two() {
// rustc::ty::layout::Align restricts align to <= 2^29
// rustc_middle::ty::layout::Align restricts align to <= 2^29
if *literal <= 1 << 29 {
Ok(*literal as u32)
} else {

View File

@ -16,7 +16,7 @@ flate2 = "1.0"
libc = "0.2"
measureme = "0.7.1"
log = "0.4"
rustc = { path = "../librustc" }
rustc_middle = { path = "../librustc_middle" }
rustc-demangle = "0.1"
rustc_attr = { path = "../librustc_attr" }
rustc_codegen_ssa = { path = "../librustc_codegen_ssa" }

View File

@ -5,19 +5,19 @@ use crate::type_::Type;
use crate::type_of::LayoutLlvmExt;
use crate::value::Value;
use rustc::bug;
use rustc::ty::layout::{self};
use rustc::ty::Ty;
use rustc_codegen_ssa::mir::operand::OperandValue;
use rustc_codegen_ssa::mir::place::PlaceRef;
use rustc_codegen_ssa::traits::*;
use rustc_codegen_ssa::MemFlags;
use rustc_middle::bug;
use rustc_middle::ty::layout::{self};
use rustc_middle::ty::Ty;
use rustc_target::abi::call::ArgAbi;
use rustc_target::abi::{HasDataLayout, LayoutOf};
use libc::c_uint;
pub use rustc::ty::layout::{FAT_PTR_ADDR, FAT_PTR_EXTRA};
pub use rustc_middle::ty::layout::{FAT_PTR_ADDR, FAT_PTR_EXTRA};
pub use rustc_target::abi::call::*;
pub use rustc_target::spec::abi::Abi;

View File

@ -1,8 +1,8 @@
use crate::attributes;
use libc::c_uint;
use rustc::bug;
use rustc::ty::TyCtxt;
use rustc_ast::expand::allocator::{AllocatorKind, AllocatorTy, ALLOCATOR_METHODS};
use rustc_middle::bug;
use rustc_middle::ty::TyCtxt;
use crate::llvm::{self, False, True};
use crate::ModuleLlvm;

View File

@ -2,15 +2,15 @@
use std::ffi::CString;
use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc::ty::layout::HasTyCtxt;
use rustc::ty::query::Providers;
use rustc::ty::{self, Ty, TyCtxt};
use rustc_codegen_ssa::traits::*;
use rustc_data_structures::const_cstr;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::small_c_str::SmallCStr;
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc_middle::ty::layout::HasTyCtxt;
use rustc_middle::ty::query::Providers;
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_session::config::{OptLevel, Sanitizer};
use rustc_session::Session;
use rustc_target::abi::call::Conv;

View File

@ -6,9 +6,6 @@ use crate::llvm::archive_ro::ArchiveRO;
use crate::llvm::{self, False, True};
use crate::{LlvmCodegenBackend, ModuleLlvm};
use log::{debug, info};
use rustc::bug;
use rustc::dep_graph::WorkProduct;
use rustc::middle::exported_symbols::SymbolExportLevel;
use rustc_codegen_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModule, ThinShared};
use rustc_codegen_ssa::back::symbol_export;
use rustc_codegen_ssa::back::write::{CodegenContext, FatLTOInput, ModuleConfig};
@ -17,6 +14,9 @@ use rustc_codegen_ssa::{ModuleCodegen, ModuleKind, RLIB_BYTECODE_EXTENSION};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_errors::{FatalError, Handler};
use rustc_hir::def_id::LOCAL_CRATE;
use rustc_middle::bug;
use rustc_middle::dep_graph::WorkProduct;
use rustc_middle::middle::exported_symbols::SymbolExportLevel;
use rustc_session::cgu_reuse_tracker::CguReuse;
use rustc_session::config::{self, Lto};

View File

@ -14,8 +14,6 @@ use crate::type_::Type;
use crate::LlvmCodegenBackend;
use crate::ModuleLlvm;
use log::debug;
use rustc::bug;
use rustc::ty::TyCtxt;
use rustc_codegen_ssa::back::write::{BitcodeSection, CodegenContext, EmitObj, ModuleConfig};
use rustc_codegen_ssa::traits::*;
use rustc_codegen_ssa::{CompiledModule, ModuleCodegen, RLIB_BYTECODE_EXTENSION};
@ -23,6 +21,8 @@ use rustc_data_structures::small_c_str::SmallCStr;
use rustc_errors::{FatalError, Handler};
use rustc_fs_util::{link_or_copy, path_to_c_string};
use rustc_hir::def_id::LOCAL_CRATE;
use rustc_middle::bug;
use rustc_middle::ty::TyCtxt;
use rustc_session::config::{self, Lto, OutputType, Passes, Sanitizer, SwitchWithOptPath};
use rustc_session::Session;

View File

@ -23,17 +23,17 @@ use crate::llvm;
use crate::metadata;
use crate::value::Value;
use rustc::dep_graph;
use rustc::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs};
use rustc::middle::cstore::EncodedMetadata;
use rustc::middle::exported_symbols;
use rustc::mir::mono::{Linkage, Visibility};
use rustc::ty::TyCtxt;
use rustc_codegen_ssa::base::maybe_create_entry_wrapper;
use rustc_codegen_ssa::mono_item::MonoItemExt;
use rustc_codegen_ssa::traits::*;
use rustc_codegen_ssa::{ModuleCodegen, ModuleKind};
use rustc_data_structures::small_c_str::SmallCStr;
use rustc_middle::dep_graph;
use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs};
use rustc_middle::middle::cstore::EncodedMetadata;
use rustc_middle::middle::exported_symbols;
use rustc_middle::mir::mono::{Linkage, Visibility};
use rustc_middle::ty::TyCtxt;
use rustc_session::config::DebugInfo;
use rustc_span::symbol::Symbol;

View File

@ -7,8 +7,6 @@ use crate::type_of::LayoutLlvmExt;
use crate::value::Value;
use libc::{c_char, c_uint};
use log::debug;
use rustc::ty::layout::{self, Align, Size, TyAndLayout};
use rustc::ty::{self, Ty, TyCtxt};
use rustc_codegen_ssa::base::to_immediate;
use rustc_codegen_ssa::common::{IntPredicate, RealPredicate, TypeKind};
use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
@ -18,6 +16,8 @@ use rustc_codegen_ssa::MemFlags;
use rustc_data_structures::const_cstr;
use rustc_data_structures::small_c_str::SmallCStr;
use rustc_hir::def_id::DefId;
use rustc_middle::ty::layout::{self, Align, Size, TyAndLayout};
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_session::config::{self, Sanitizer};
use rustc_target::spec::{HasTargetSpec, Target};
use std::borrow::Cow;
@ -302,9 +302,9 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
lhs: Self::Value,
rhs: Self::Value,
) -> (Self::Value, Self::Value) {
use rustc::ty::{Int, Uint};
use rustc_ast::ast::IntTy::*;
use rustc_ast::ast::UintTy::*;
use rustc_middle::ty::{Int, Uint};
let new_kind = match ty.kind {
Int(t @ Isize) => Int(t.normalize(self.tcx.sess.target.ptr_width)),

View File

@ -12,8 +12,8 @@ use crate::value::Value;
use log::debug;
use rustc_codegen_ssa::traits::*;
use rustc::ty::layout::{FnAbiExt, HasTyCtxt};
use rustc::ty::{Instance, TypeFoldable};
use rustc_middle::ty::layout::{FnAbiExt, HasTyCtxt};
use rustc_middle::ty::{Instance, TypeFoldable};
/// Codegens a reference to a fn/method item, monomorphizing and
/// inlining as it goes.

View File

@ -8,13 +8,13 @@ use crate::type_::Type;
use crate::type_of::LayoutLlvmExt;
use crate::value::Value;
use log::debug;
use rustc::bug;
use rustc_codegen_ssa::traits::*;
use rustc_middle::bug;
use crate::consts::const_alloc_to_llvm;
use rustc::mir::interpret::{Allocation, GlobalAlloc, Scalar};
use rustc::ty::layout::{self, HasDataLayout, LayoutOf, Size, TyAndLayout};
use rustc_codegen_ssa::mir::place::PlaceRef;
use rustc_middle::mir::interpret::{Allocation, GlobalAlloc, Scalar};
use rustc_middle::ty::layout::{self, HasDataLayout, LayoutOf, Size, TyAndLayout};
use libc::{c_char, c_uint};

View File

@ -7,16 +7,18 @@ use crate::type_of::LayoutLlvmExt;
use crate::value::Value;
use libc::c_uint;
use log::debug;
use rustc::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs};
use rustc::mir::interpret::{read_target_uint, Allocation, ConstValue, ErrorHandled, Pointer};
use rustc::mir::mono::MonoItem;
use rustc::ty::layout::{self, Align, LayoutOf, Size};
use rustc::ty::{self, Instance, Ty};
use rustc::{bug, span_bug};
use rustc_codegen_ssa::traits::*;
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::Node;
use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs};
use rustc_middle::mir::interpret::{
read_target_uint, Allocation, ConstValue, ErrorHandled, Pointer,
};
use rustc_middle::mir::mono::MonoItem;
use rustc_middle::ty::layout::{self, Align, LayoutOf, Size};
use rustc_middle::ty::{self, Instance, Ty};
use rustc_middle::{bug, span_bug};
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use rustc_target::abi::HasDataLayout;

View File

@ -6,18 +6,18 @@ use crate::llvm_util;
use crate::type_::Type;
use crate::value::Value;
use rustc::bug;
use rustc::mir::mono::CodegenUnit;
use rustc::ty::layout::{
HasParamEnv, LayoutError, LayoutOf, PointeeInfo, Size, TyAndLayout, VariantIdx,
};
use rustc::ty::{self, Instance, Ty, TyCtxt};
use rustc_codegen_ssa::base::wants_msvc_seh;
use rustc_codegen_ssa::traits::*;
use rustc_data_structures::base_n;
use rustc_data_structures::const_cstr;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::small_c_str::SmallCStr;
use rustc_middle::bug;
use rustc_middle::mir::mono::CodegenUnit;
use rustc_middle::ty::layout::{
HasParamEnv, LayoutError, LayoutOf, PointeeInfo, Size, TyAndLayout, VariantIdx,
};
use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
use rustc_session::config::{self, CFGuard, DebugInfo};
use rustc_session::Session;
use rustc_span::source_map::{Span, DUMMY_SP};

View File

@ -6,7 +6,7 @@ use rustc_codegen_ssa::traits::*;
use crate::common::CodegenCx;
use crate::llvm;
use crate::llvm::debuginfo::{DIScope, DISubprogram};
use rustc::mir::{Body, SourceScope};
use rustc_middle::mir::{Body, SourceScope};
use rustc_session::config::DebugInfo;
use rustc_index::bit_set::BitSet;

View File

@ -5,8 +5,8 @@ use crate::llvm;
use crate::builder::Builder;
use crate::common::CodegenCx;
use crate::value::Value;
use rustc::bug;
use rustc_codegen_ssa::traits::*;
use rustc_middle::bug;
use rustc_session::config::DebugInfo;
use rustc_ast::attr;

View File

@ -20,17 +20,6 @@ use crate::llvm_util;
use crate::value::Value;
use log::debug;
use rustc::ich::NodeIdHashingMode;
use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc::mir::interpret::truncate;
use rustc::mir::{self, Field, GeneratorLayout};
use rustc::ty::layout::{
self, Align, Integer, IntegerExt, LayoutOf, PrimitiveExt, Size, TyAndLayout, VariantIdx,
};
use rustc::ty::subst::{GenericArgKind, SubstsRef};
use rustc::ty::Instance;
use rustc::ty::{self, AdtKind, ParamEnv, Ty, TyCtxt};
use rustc::{bug, span_bug};
use rustc_ast::ast;
use rustc_codegen_ssa::traits::*;
use rustc_data_structures::const_cstr;
@ -41,6 +30,17 @@ use rustc_fs_util::path_to_c_string;
use rustc_hir::def::CtorKind;
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
use rustc_index::vec::{Idx, IndexVec};
use rustc_middle::ich::NodeIdHashingMode;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc_middle::mir::interpret::truncate;
use rustc_middle::mir::{self, Field, GeneratorLayout};
use rustc_middle::ty::layout::{
self, Align, Integer, IntegerExt, LayoutOf, PrimitiveExt, Size, TyAndLayout, VariantIdx,
};
use rustc_middle::ty::subst::{GenericArgKind, SubstsRef};
use rustc_middle::ty::Instance;
use rustc_middle::ty::{self, AdtKind, ParamEnv, Ty, TyCtxt};
use rustc_middle::{bug, span_bug};
use rustc_session::config::{self, DebugInfo};
use rustc_span::symbol::{Interner, Symbol};
use rustc_span::{self, FileName, Span};

View File

@ -12,28 +12,28 @@ use crate::llvm;
use crate::llvm::debuginfo::{
DIArray, DIBuilder, DIFile, DIFlags, DILexicalBlock, DISPFlags, DIScope, DIType, DIVariable,
};
use rustc::ty::subst::{GenericArgKind, SubstsRef};
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LOCAL_CRATE};
use rustc_middle::ty::subst::{GenericArgKind, SubstsRef};
use crate::abi::FnAbi;
use crate::builder::Builder;
use crate::common::CodegenCx;
use crate::value::Value;
use rustc::mir;
use rustc::ty::{self, Instance, ParamEnv, Ty};
use rustc_codegen_ssa::debuginfo::type_names;
use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext, VariableKind};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_index::vec::IndexVec;
use rustc_middle::mir;
use rustc_middle::ty::{self, Instance, ParamEnv, Ty};
use rustc_session::config::{self, DebugInfo};
use libc::c_uint;
use log::debug;
use std::cell::RefCell;
use rustc::ty::layout::{self, HasTyCtxt, LayoutOf, Size};
use rustc_ast::ast;
use rustc_codegen_ssa::traits::*;
use rustc_middle::ty::layout::{self, HasTyCtxt, LayoutOf, Size};
use rustc_span::symbol::Symbol;
use rustc_span::{self, BytePos, Span};
use smallvec::SmallVec;

View File

@ -1,7 +1,7 @@
// Namespace Handling.
use super::utils::{debug_context, DIB};
use rustc::ty::{self, Instance};
use rustc_middle::ty::{self, Instance};
use crate::common::CodegenCx;
use crate::llvm;

View File

@ -3,8 +3,8 @@
use super::namespace::item_namespace;
use super::CrateDebugContext;
use rustc::ty::DefIdTree;
use rustc_hir::def_id::DefId;
use rustc_middle::ty::DefIdTree;
use crate::common::CodegenCx;
use crate::llvm;

View File

@ -19,8 +19,8 @@ use crate::llvm::AttributePlace::Function;
use crate::type_::Type;
use crate::value::Value;
use log::debug;
use rustc::ty::Ty;
use rustc_codegen_ssa::traits::*;
use rustc_middle::ty::Ty;
/// Declare a function.
///

View File

@ -7,9 +7,6 @@ use crate::type_::Type;
use crate::type_of::LayoutLlvmExt;
use crate::va_arg::emit_va_arg;
use crate::value::Value;
use rustc::ty::layout::{self, FnAbiExt, HasTyCtxt, LayoutOf, Primitive};
use rustc::ty::{self, Ty};
use rustc::{bug, span_bug};
use rustc_ast::ast;
use rustc_codegen_ssa::base::{compare_simd_types, to_immediate, wants_msvc_seh};
use rustc_codegen_ssa::common::{IntPredicate, TypeKind};
@ -18,6 +15,9 @@ use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
use rustc_codegen_ssa::mir::place::PlaceRef;
use rustc_codegen_ssa::MemFlags;
use rustc_hir as hir;
use rustc_middle::ty::layout::{self, FnAbiExt, HasTyCtxt, LayoutOf, Primitive};
use rustc_middle::ty::{self, Ty};
use rustc_middle::{bug, span_bug};
use rustc_target::abi::HasDataLayout;
use rustc_codegen_ssa::common::span_invalid_monomorphization_error;
@ -1390,8 +1390,8 @@ fn generic_simd_intrinsic(
fn simd_simple_float_intrinsic(
name: &str,
in_elem: &::rustc::ty::TyS<'_>,
in_ty: &::rustc::ty::TyS<'_>,
in_elem: &::rustc_middle::ty::TyS<'_>,
in_ty: &::rustc_middle::ty::TyS<'_>,
in_len: u64,
bx: &mut Builder<'a, 'll, 'tcx>,
span: Span,

View File

@ -17,10 +17,6 @@
use back::write::{create_informational_target_machine, create_target_machine};
pub use llvm_util::target_features;
use rustc::dep_graph::{DepGraph, WorkProduct};
use rustc::middle::cstore::{EncodedMetadata, MetadataLoaderDyn};
use rustc::ty::{self, TyCtxt};
use rustc::util::common::ErrorReported;
use rustc_ast::expand::allocator::AllocatorKind;
use rustc_codegen_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModule};
use rustc_codegen_ssa::back::write::{CodegenContext, FatLTOInput, ModuleConfig};
@ -28,6 +24,10 @@ use rustc_codegen_ssa::traits::*;
use rustc_codegen_ssa::ModuleCodegen;
use rustc_codegen_ssa::{CodegenResults, CompiledModule};
use rustc_errors::{FatalError, Handler};
use rustc_middle::dep_graph::{DepGraph, WorkProduct};
use rustc_middle::middle::cstore::{EncodedMetadata, MetadataLoaderDyn};
use rustc_middle::ty::{self, TyCtxt};
use rustc_middle::util::common::ErrorReported;
use rustc_serialize::json;
use rustc_session::config::{self, OptLevel, OutputFilenames, PrintRequest};
use rustc_session::Session;

View File

@ -1,9 +1,9 @@
use crate::back::write::create_informational_target_machine;
use crate::llvm;
use libc::c_int;
use rustc::bug;
use rustc_data_structures::fx::FxHashSet;
use rustc_feature::UnstableFeatures;
use rustc_middle::bug;
use rustc_session::config::PrintRequest;
use rustc_session::Session;
use rustc_span::symbol::sym;

View File

@ -1,7 +1,7 @@
use crate::llvm;
use crate::llvm::archive_ro::ArchiveRO;
use crate::llvm::{mk_section_iter, False, ObjectFile};
use rustc::middle::cstore::MetadataLoader;
use rustc_middle::middle::cstore::MetadataLoader;
use rustc_target::spec::Target;
use log::debug;

View File

@ -5,13 +5,13 @@ use crate::context::CodegenCx;
use crate::llvm;
use crate::type_of::LayoutLlvmExt;
use log::debug;
use rustc::mir::mono::{Linkage, Visibility};
use rustc::ty::layout::{FnAbiExt, LayoutOf};
use rustc::ty::{Instance, TypeFoldable};
use rustc_codegen_ssa::traits::*;
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
use rustc_middle::mir::mono::{Linkage, Visibility};
use rustc_middle::ty::layout::{FnAbiExt, LayoutOf};
use rustc_middle::ty::{Instance, TypeFoldable};
pub use rustc::mir::mono::MonoItem;
pub use rustc_middle::mir::mono::MonoItem;
impl PreDefineMethods<'tcx> for CodegenCx<'ll, 'tcx> {
fn predefine_static(

View File

@ -1,20 +1,19 @@
pub use crate::llvm::Type;
use crate::context::CodegenCx;
use crate::llvm;
use crate::llvm::{Bool, False, True};
use crate::value::Value;
use rustc::bug;
use rustc_codegen_ssa::traits::*;
use crate::abi::{FnAbiLlvmExt, LlvmType};
use crate::common;
use crate::context::CodegenCx;
use crate::llvm;
use crate::llvm::{Bool, False, True};
use crate::type_of::LayoutLlvmExt;
use rustc::ty::layout::{self, Align, Size, TyAndLayout};
use rustc::ty::Ty;
use crate::value::Value;
use rustc_ast::ast;
use rustc_codegen_ssa::common::TypeKind;
use rustc_codegen_ssa::traits::*;
use rustc_data_structures::small_c_str::SmallCStr;
use rustc_middle::bug;
use rustc_middle::ty::layout::{self, Align, Size, TyAndLayout};
use rustc_middle::ty::Ty;
use rustc_target::abi::call::{CastTarget, FnAbi, Reg};
use std::fmt;

View File

@ -2,11 +2,11 @@ use crate::abi::FnAbi;
use crate::common::*;
use crate::type_::Type;
use log::debug;
use rustc::bug;
use rustc::ty::layout::{self, Align, FnAbiExt, LayoutOf, PointeeInfo, Size, TyAndLayout};
use rustc::ty::print::obsolete::DefPathBasedNames;
use rustc::ty::{self, Ty, TypeFoldable};
use rustc_codegen_ssa::traits::*;
use rustc_middle::bug;
use rustc_middle::ty::layout::{self, Align, FnAbiExt, LayoutOf, PointeeInfo, Size, TyAndLayout};
use rustc_middle::ty::print::obsolete::DefPathBasedNames;
use rustc_middle::ty::{self, Ty, TypeFoldable};
use rustc_target::abi::TyAndLayoutMethods;
use std::fmt::Write;
@ -221,7 +221,7 @@ impl<'tcx> LayoutLlvmExt<'tcx> for TyAndLayout<'tcx> {
}
}
/// Gets the LLVM type corresponding to a Rust type, i.e., `rustc::ty::Ty`.
/// Gets the LLVM type corresponding to a Rust type, i.e., `rustc_middle::ty::Ty`.
/// The pointee type of the pointer in `PlaceRef` is always this type.
/// For sized types, it is also the right LLVM type for an `alloca`
/// containing a value of that type, and most immediates (except `bool`).

View File

@ -2,12 +2,12 @@ use crate::builder::Builder;
use crate::type_::Type;
use crate::type_of::LayoutLlvmExt;
use crate::value::Value;
use rustc::ty::layout::{Align, HasDataLayout, HasTyCtxt, LayoutOf, Size};
use rustc::ty::Ty;
use rustc_codegen_ssa::mir::operand::OperandRef;
use rustc_codegen_ssa::traits::{
BaseTypeMethods, BuilderMethods, ConstMethods, DerivedTypeMethods,
};
use rustc_middle::ty::layout::{Align, HasDataLayout, HasTyCtxt, LayoutOf, Size};
use rustc_middle::ty::Ty;
#[allow(dead_code)]
fn round_pointer_up_to_alignment(

View File

@ -22,7 +22,7 @@ tempfile = "3.1"
rustc_serialize = { path = "../libserialize", package = "serialize" }
rustc_ast = { path = "../librustc_ast" }
rustc_span = { path = "../librustc_span" }
rustc = { path = "../librustc" }
rustc_middle = { path = "../librustc_middle" }
rustc_apfloat = { path = "../librustc_apfloat" }
rustc_attr = { path = "../librustc_attr" }
rustc_symbol_mangling = { path = "../librustc_symbol_mangling" }

View File

@ -1,8 +1,8 @@
use rustc::middle::cstore::{EncodedMetadata, LibSource, NativeLibrary, NativeLibraryKind};
use rustc::middle::dependency_format::Linkage;
use rustc_data_structures::fx::FxHashSet;
use rustc_fs_util::fix_windows_verbatim_for_gcc;
use rustc_hir::def_id::CrateNum;
use rustc_middle::middle::cstore::{EncodedMetadata, LibSource, NativeLibrary, NativeLibraryKind};
use rustc_middle::middle::dependency_format::Linkage;
use rustc_session::config::{
self, CFGuard, DebugInfo, OutputFilenames, OutputType, PrintRequest, Sanitizer,
};

View File

@ -8,10 +8,10 @@ use std::io::prelude::*;
use std::io::{self, BufWriter};
use std::path::{Path, PathBuf};
use rustc::middle::dependency_format::Linkage;
use rustc::ty::TyCtxt;
use rustc_data_structures::fx::FxHashMap;
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
use rustc_middle::middle::dependency_format::Linkage;
use rustc_middle::ty::TyCtxt;
use rustc_serialize::{json, Encoder};
use rustc_session::config::{self, CrateType, DebugInfo, LinkerPluginLto, Lto, OptLevel};
use rustc_session::Session;

View File

@ -3,8 +3,8 @@ use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use rustc::middle::cstore::LibSource;
use rustc_hir::def_id::CrateNum;
use rustc_middle::middle::cstore::LibSource;
pub struct RPathConfig<'a> {
pub used_crates: &'a [(CrateNum, LibSource)],

View File

@ -1,12 +1,6 @@
use std::collections::hash_map::Entry::*;
use std::sync::Arc;
use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc::middle::exported_symbols::{metadata_symbol_name, ExportedSymbol, SymbolExportLevel};
use rustc::ty::query::Providers;
use rustc::ty::subst::{GenericArgKind, SubstsRef};
use rustc::ty::Instance;
use rustc::ty::{SymbolName, TyCtxt};
use rustc_ast::expand::allocator::ALLOCATOR_METHODS;
use rustc_data_structures::fingerprint::Fingerprint;
use rustc_data_structures::fx::FxHashMap;
@ -14,6 +8,14 @@ use rustc_hir as hir;
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, CRATE_DEF_INDEX, LOCAL_CRATE};
use rustc_hir::Node;
use rustc_index::vec::IndexVec;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc_middle::middle::exported_symbols::{
metadata_symbol_name, ExportedSymbol, SymbolExportLevel,
};
use rustc_middle::ty::query::Providers;
use rustc_middle::ty::subst::{GenericArgKind, SubstsRef};
use rustc_middle::ty::Instance;
use rustc_middle::ty::{SymbolName, TyCtxt};
use rustc_session::config::{self, Sanitizer};
pub fn threshold(tcx: TyCtxt<'_>) -> SymbolExportLevel {
@ -221,8 +223,8 @@ fn exported_symbols_provider_local(
}
if tcx.sess.opts.share_generics() && tcx.local_crate_exports_generics() {
use rustc::mir::mono::{Linkage, MonoItem, Visibility};
use rustc::ty::InstanceDef;
use rustc_middle::mir::mono::{Linkage, MonoItem, Visibility};
use rustc_middle::ty::InstanceDef;
// Normally, we require that shared monomorphizations are not hidden,
// because if we want to re-use a monomorphization from a Rust dylib, it

View File

@ -10,10 +10,6 @@ use crate::{
use crate::traits::*;
use jobserver::{Acquired, Client};
use rustc::dep_graph::{WorkProduct, WorkProductFileKind, WorkProductId};
use rustc::middle::cstore::EncodedMetadata;
use rustc::middle::exported_symbols::SymbolExportLevel;
use rustc::ty::TyCtxt;
use rustc_ast::attr;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::profiling::SelfProfilerRef;
@ -28,6 +24,10 @@ use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
use rustc_incremental::{
copy_cgu_workproducts_to_incr_comp_cache_dir, in_incr_comp_dir, in_incr_comp_dir_sess,
};
use rustc_middle::dep_graph::{WorkProduct, WorkProductFileKind, WorkProductId};
use rustc_middle::middle::cstore::EncodedMetadata;
use rustc_middle::middle::exported_symbols::SymbolExportLevel;
use rustc_middle::ty::TyCtxt;
use rustc_session::cgu_reuse_tracker::CguReuseTracker;
use rustc_session::config::{
self, Lto, OutputFilenames, OutputType, Passes, Sanitizer, SwitchWithOptPath,

View File

@ -25,16 +25,6 @@ use crate::mir::place::PlaceRef;
use crate::traits::*;
use crate::{CachedModuleCodegen, CrateInfo, MemFlags, ModuleCodegen, ModuleKind};
use rustc::middle::codegen_fn_attrs::CodegenFnAttrs;
use rustc::middle::cstore::EncodedMetadata;
use rustc::middle::cstore::{self, LinkagePreference};
use rustc::middle::lang_items;
use rustc::middle::lang_items::StartFnLangItem;
use rustc::mir::mono::{CodegenUnit, CodegenUnitNameBuilder, MonoItem};
use rustc::ty::layout::{self, Align, HasTyCtxt, LayoutOf, TyAndLayout, VariantIdx};
use rustc::ty::layout::{FAT_PTR_ADDR, FAT_PTR_EXTRA};
use rustc::ty::query::Providers;
use rustc::ty::{self, Instance, Ty, TyCtxt};
use rustc_attr as attr;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::profiling::print_time_passes_entry;
@ -42,6 +32,16 @@ use rustc_data_structures::sync::{par_iter, Lock, ParallelIterator};
use rustc_hir as hir;
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
use rustc_index::vec::Idx;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
use rustc_middle::middle::cstore::EncodedMetadata;
use rustc_middle::middle::cstore::{self, LinkagePreference};
use rustc_middle::middle::lang_items;
use rustc_middle::middle::lang_items::StartFnLangItem;
use rustc_middle::mir::mono::{CodegenUnit, CodegenUnitNameBuilder, MonoItem};
use rustc_middle::ty::layout::{self, Align, HasTyCtxt, LayoutOf, TyAndLayout, VariantIdx};
use rustc_middle::ty::layout::{FAT_PTR_ADDR, FAT_PTR_EXTRA};
use rustc_middle::ty::query::Providers;
use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
use rustc_session::cgu_reuse_tracker::CguReuse;
use rustc_session::config::{self, EntryFnType, Lto};
use rustc_session::Session;
@ -557,7 +557,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
// one instead. If nothing exists then it's our job to generate the
// allocator!
let any_dynamic_crate = tcx.dependency_formats(LOCAL_CRATE).iter().any(|(_, list)| {
use rustc::middle::dependency_format::Linkage;
use rustc_middle::middle::dependency_format::Linkage;
list.iter().any(|&linkage| linkage == Linkage::Dynamic)
});
let allocator_module = if any_dynamic_crate {

View File

@ -1,14 +1,14 @@
#![allow(non_camel_case_types, non_snake_case)]
use rustc::ty::{Ty, TyCtxt};
use rustc_errors::struct_span_err;
use rustc_middle::ty::{Ty, TyCtxt};
use rustc_session::Session;
use rustc_span::Span;
use crate::base;
use crate::traits::*;
use rustc::middle::lang_items::LangItem;
use rustc_hir::def_id::DefId;
use rustc_middle::middle::lang_items::LangItem;
use crate::traits::BuilderMethods;
use rustc_hir as hir;

View File

@ -1,9 +1,9 @@
// Type Names for Debug Info.
use rustc::ty::{self, subst::SubstsRef, Ty, TyCtxt};
use rustc_data_structures::fx::FxHashSet;
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_middle::ty::{self, subst::SubstsRef, Ty, TyCtxt};
// Compute the name of the type as it should be stored in debuginfo. Does not do
// any caching, i.e., calling the function twice with the same type will also do

View File

@ -5,7 +5,7 @@
use crate::common::IntPredicate;
use crate::meth;
use crate::traits::*;
use rustc::ty::{self, Ty};
use rustc_middle::ty::{self, Ty};
pub fn size_and_align_of_dst<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx,

View File

@ -15,17 +15,17 @@
#[macro_use]
extern crate log;
#[macro_use]
extern crate rustc;
extern crate rustc_middle;
use rustc::dep_graph::WorkProduct;
use rustc::middle::cstore::{CrateSource, LibSource, NativeLibrary};
use rustc::middle::dependency_format::Dependencies;
use rustc::middle::lang_items::LangItem;
use rustc::ty::query::Providers;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::svh::Svh;
use rustc_data_structures::sync::Lrc;
use rustc_hir::def_id::CrateNum;
use rustc_middle::dep_graph::WorkProduct;
use rustc_middle::middle::cstore::{CrateSource, LibSource, NativeLibrary};
use rustc_middle::middle::dependency_format::Dependencies;
use rustc_middle::middle::lang_items::LangItem;
use rustc_middle::ty::query::Providers;
use rustc_session::config::{OutputFilenames, OutputType, RUST_CGU_EXT};
use rustc_span::symbol::Symbol;
use std::path::{Path, PathBuf};
@ -144,7 +144,7 @@ pub struct CodegenResults {
pub allocator_module: Option<CompiledModule>,
pub metadata_module: Option<CompiledModule>,
pub crate_hash: Svh,
pub metadata: rustc::middle::cstore::EncodedMetadata,
pub metadata: rustc_middle::middle::cstore::EncodedMetadata,
pub windows_subsystem: Option<String>,
pub linker_info: back::linker::LinkerInfo,
pub crate_info: CrateInfo,

View File

@ -1,6 +1,6 @@
use crate::traits::*;
use rustc::ty::{self, Instance, Ty};
use rustc_middle::ty::{self, Instance, Ty};
use rustc_target::abi::call::FnAbi;
#[derive(Copy, Clone, Debug)]

View File

@ -3,16 +3,16 @@
use super::FunctionCx;
use crate::traits::*;
use rustc::mir::traversal;
use rustc::mir::visit::{
MutatingUseContext, NonMutatingUseContext, NonUseContext, PlaceContext, Visitor,
};
use rustc::mir::{self, Location, TerminatorKind};
use rustc::ty;
use rustc::ty::layout::{HasTyCtxt, LayoutOf};
use rustc_data_structures::graph::dominators::Dominators;
use rustc_index::bit_set::BitSet;
use rustc_index::vec::{Idx, IndexVec};
use rustc_middle::mir::traversal;
use rustc_middle::mir::visit::{
MutatingUseContext, NonMutatingUseContext, NonUseContext, PlaceContext, Visitor,
};
use rustc_middle::mir::{self, Location, TerminatorKind};
use rustc_middle::ty;
use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf};
pub fn non_ssa_locals<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
fx: &FunctionCx<'a, 'tcx, Bx>,

View File

@ -9,12 +9,12 @@ use crate::meth;
use crate::traits::*;
use crate::MemFlags;
use rustc::middle::lang_items;
use rustc::mir;
use rustc::mir::AssertKind;
use rustc::ty::layout::{self, FnAbiExt, HasTyCtxt, LayoutOf};
use rustc::ty::{self, Instance, Ty, TypeFoldable};
use rustc_index::vec::Idx;
use rustc_middle::middle::lang_items;
use rustc_middle::mir;
use rustc_middle::mir::AssertKind;
use rustc_middle::ty::layout::{self, FnAbiExt, HasTyCtxt, LayoutOf};
use rustc_middle::ty::{self, Instance, Ty, TypeFoldable};
use rustc_span::{source_map::Span, symbol::Symbol};
use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode};
use rustc_target::spec::abi::Abi;

View File

@ -1,10 +1,10 @@
use crate::mir::operand::OperandRef;
use crate::traits::*;
use rustc::mir;
use rustc::mir::interpret::{ConstValue, ErrorHandled};
use rustc::ty::layout::{self, HasTyCtxt};
use rustc::ty::{self, Ty};
use rustc_index::vec::Idx;
use rustc_middle::mir;
use rustc_middle::mir::interpret::{ConstValue, ErrorHandled};
use rustc_middle::ty::layout::{self, HasTyCtxt};
use rustc_middle::ty::{self, Ty};
use rustc_span::source_map::Span;
use super::FunctionCx;

View File

@ -1,9 +1,9 @@
use crate::traits::*;
use rustc::mir;
use rustc::ty;
use rustc::ty::layout::{LayoutOf, Size};
use rustc_hir::def_id::CrateNum;
use rustc_index::vec::IndexVec;
use rustc_middle::mir;
use rustc_middle::ty;
use rustc_middle::ty::layout::{LayoutOf, Size};
use rustc_session::config::DebugInfo;
use rustc_span::symbol::{kw, Symbol};

View File

@ -1,8 +1,8 @@
use crate::base;
use crate::traits::*;
use rustc::mir;
use rustc::ty::layout::{FnAbiExt, HasTyCtxt, TyAndLayout};
use rustc::ty::{self, Instance, Ty, TypeFoldable};
use rustc_middle::mir;
use rustc_middle::ty::layout::{FnAbiExt, HasTyCtxt, TyAndLayout};
use rustc_middle::ty::{self, Instance, Ty, TypeFoldable};
use rustc_target::abi::call::{FnAbi, PassMode};
use std::iter;
@ -13,7 +13,7 @@ use rustc_index::vec::IndexVec;
use self::analyze::CleanupKind;
use self::debuginfo::{FunctionDebugContext, PerLocalVarDebugInfo};
use self::place::PlaceRef;
use rustc::mir::traversal;
use rustc_middle::mir::traversal;
use self::operand::{OperandRef, OperandValue};

View File

@ -6,10 +6,10 @@ use crate::glue;
use crate::traits::*;
use crate::MemFlags;
use rustc::mir;
use rustc::mir::interpret::{ConstValue, ErrorHandled, Pointer, Scalar};
use rustc::ty::layout::{self, Align, LayoutOf, Size, TyAndLayout};
use rustc::ty::Ty;
use rustc_middle::mir;
use rustc_middle::mir::interpret::{ConstValue, ErrorHandled, Pointer, Scalar};
use rustc_middle::ty::layout::{self, Align, LayoutOf, Size, TyAndLayout};
use rustc_middle::ty::Ty;
use std::fmt;

View File

@ -6,10 +6,10 @@ use crate::glue;
use crate::traits::*;
use crate::MemFlags;
use rustc::mir;
use rustc::mir::tcx::PlaceTy;
use rustc::ty::layout::{self, Align, HasTyCtxt, LayoutOf, TyAndLayout, VariantIdx};
use rustc::ty::{self, Ty};
use rustc_middle::mir;
use rustc_middle::mir::tcx::PlaceTy;
use rustc_middle::ty::layout::{self, Align, HasTyCtxt, LayoutOf, TyAndLayout, VariantIdx};
use rustc_middle::ty::{self, Ty};
#[derive(Copy, Clone, Debug)]
pub struct PlaceRef<'tcx, V> {

View File

@ -7,12 +7,12 @@ use crate::common::{self, IntPredicate, RealPredicate};
use crate::traits::*;
use crate::MemFlags;
use rustc::middle::lang_items::ExchangeMallocFnLangItem;
use rustc::mir;
use rustc::ty::cast::{CastTy, IntTy};
use rustc::ty::layout::{self, HasTyCtxt, LayoutOf};
use rustc::ty::{self, adjustment::PointerCast, Instance, Ty, TyCtxt};
use rustc_apfloat::{ieee, Float, Round, Status};
use rustc_middle::middle::lang_items::ExchangeMallocFnLangItem;
use rustc_middle::mir;
use rustc_middle::ty::cast::{CastTy, IntTy};
use rustc_middle::ty::layout::{self, HasTyCtxt, LayoutOf};
use rustc_middle::ty::{self, adjustment::PointerCast, Instance, Ty, TyCtxt};
use rustc_span::source_map::{Span, DUMMY_SP};
use rustc_span::symbol::sym;

View File

@ -1,5 +1,5 @@
use rustc::mir;
use rustc_errors::struct_span_err;
use rustc_middle::mir;
use super::FunctionCx;
use super::LocalRef;

View File

@ -1,10 +1,10 @@
use crate::base;
use crate::traits::*;
use rustc::mir::mono::{Linkage, Visibility};
use rustc::ty::layout::HasTyCtxt;
use rustc_hir as hir;
use rustc_middle::mir::mono::{Linkage, Visibility};
use rustc_middle::ty::layout::HasTyCtxt;
use rustc::mir::mono::MonoItem;
use rustc_middle::mir::mono::MonoItem;
pub trait MonoItemExt<'a, 'tcx> {
fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx);

View File

@ -1,5 +1,5 @@
use super::BackendTypes;
use rustc::ty::Ty;
use rustc_middle::ty::Ty;
use rustc_target::abi::call::FnAbi;
pub trait AbiBuilderMethods<'tcx>: BackendTypes {

View File

@ -2,13 +2,13 @@ use super::write::WriteBackendMethods;
use super::CodegenObject;
use crate::ModuleCodegen;
use rustc::dep_graph::DepGraph;
use rustc::middle::cstore::{EncodedMetadata, MetadataLoaderDyn};
use rustc::ty::layout::{HasTyCtxt, LayoutOf, TyAndLayout};
use rustc::ty::query::Providers;
use rustc::ty::{Ty, TyCtxt};
use rustc::util::common::ErrorReported;
use rustc_ast::expand::allocator::AllocatorKind;
use rustc_middle::dep_graph::DepGraph;
use rustc_middle::middle::cstore::{EncodedMetadata, MetadataLoaderDyn};
use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, TyAndLayout};
use rustc_middle::ty::query::Providers;
use rustc_middle::ty::{Ty, TyCtxt};
use rustc_middle::util::common::ErrorReported;
use rustc_session::{
config::{self, OutputFilenames, PrintRequest},
Session,

View File

@ -12,8 +12,8 @@ use crate::mir::operand::OperandRef;
use crate::mir::place::PlaceRef;
use crate::MemFlags;
use rustc::ty::layout::{Align, HasParamEnv, Size};
use rustc::ty::Ty;
use rustc_middle::ty::layout::{Align, HasParamEnv, Size};
use rustc_middle::ty::Ty;
use rustc_target::spec::HasTargetSpec;
use std::iter::TrustedLen;

View File

@ -1,8 +1,8 @@
use super::BackendTypes;
use crate::mir::place::PlaceRef;
use rustc::mir::interpret::Allocation;
use rustc::mir::interpret::Scalar;
use rustc::ty::layout;
use rustc_middle::mir::interpret::Allocation;
use rustc_middle::mir::interpret::Scalar;
use rustc_middle::ty::layout;
use rustc_span::Symbol;
pub trait ConstMethods<'tcx>: BackendTypes {

View File

@ -1,10 +1,10 @@
use super::BackendTypes;
use crate::mir::debuginfo::{FunctionDebugContext, VariableKind};
use rustc::mir;
use rustc::ty::layout::Size;
use rustc::ty::{Instance, Ty};
use rustc_ast::ast::Name;
use rustc_hir::def_id::CrateNum;
use rustc_middle::mir;
use rustc_middle::ty::layout::Size;
use rustc_middle::ty::{Instance, Ty};
use rustc_span::{SourceFile, Span};
use rustc_target::abi::call::FnAbi;

View File

@ -1,7 +1,7 @@
use super::BackendTypes;
use rustc::mir::mono::{Linkage, Visibility};
use rustc::ty::{Instance, Ty};
use rustc_hir::def_id::DefId;
use rustc_middle::mir::mono::{Linkage, Visibility};
use rustc_middle::ty::{Instance, Ty};
use rustc_target::abi::call::FnAbi;
pub trait DeclareMethods<'tcx>: BackendTypes {

View File

@ -1,6 +1,6 @@
use super::BackendTypes;
use crate::mir::operand::OperandRef;
use rustc::ty::{self, Ty};
use rustc_middle::ty::{self, Ty};
use rustc_span::Span;
use rustc_target::abi::call::FnAbi;

View File

@ -1,7 +1,7 @@
use super::BackendTypes;
use rustc::mir::mono::CodegenUnit;
use rustc::ty::{self, Instance, Ty};
use rustc_data_structures::fx::FxHashMap;
use rustc_middle::mir::mono::CodegenUnit;
use rustc_middle::ty::{self, Instance, Ty};
use rustc_session::Session;
use std::cell::RefCell;
use std::sync::Arc;

View File

@ -42,7 +42,7 @@ pub use self::type_::{
};
pub use self::write::{ModuleBufferMethods, ThinBufferMethods, WriteBackendMethods};
use rustc::ty::layout::{HasParamEnv, HasTyCtxt};
use rustc_middle::ty::layout::{HasParamEnv, HasTyCtxt};
use rustc_target::spec::HasTargetSpec;
use std::fmt;

View File

@ -1,6 +1,6 @@
use super::BackendTypes;
use rustc::ty::layout::Align;
use rustc_hir::def_id::DefId;
use rustc_middle::ty::layout::Align;
pub trait StaticMethods: BackendTypes {
fn static_addr_of(&self, cv: Self::Value, align: Align, kind: Option<&str>) -> Self::Value;

View File

@ -3,8 +3,8 @@ use super::Backend;
use super::HasCodegen;
use crate::common::TypeKind;
use crate::mir::place::PlaceRef;
use rustc::ty::layout::{self, TyAndLayout};
use rustc::ty::{self, Ty};
use rustc_middle::ty::layout::{self, TyAndLayout};
use rustc_middle::ty::{self, Ty};
use rustc_span::DUMMY_SP;
use rustc_target::abi::call::{ArgAbi, CastTarget, FnAbi, Reg};
@ -54,7 +54,7 @@ pub trait DerivedTypeMethods<'tcx>: BaseTypeMethods<'tcx> + MiscMethods<'tcx> {
}
fn type_from_integer(&self, i: layout::Integer) -> Self::Type {
use rustc::ty::layout::Integer::*;
use rustc_middle::ty::layout::Integer::*;
match i {
I8 => self.type_i8(),
I16 => self.type_i16(),

View File

@ -2,8 +2,8 @@ use crate::back::lto::{LtoModuleCodegen, SerializedModule, ThinModule};
use crate::back::write::{CodegenContext, FatLTOInput, ModuleConfig};
use crate::{CompiledModule, ModuleCodegen};
use rustc::dep_graph::WorkProduct;
use rustc_errors::{FatalError, Handler};
use rustc_middle::dep_graph::WorkProduct;
pub trait WriteBackendMethods: 'static + Sized + Clone {
type Module: Send + Sync;

View File

@ -114,6 +114,6 @@ impl<F: Fn()> Drop for OnDrop<F> {
}
}
// See comments in src/librustc/lib.rs
// See comments in src/librustc_middle/lib.rs
#[doc(hidden)]
pub fn __noop_fix_for_27438() {}

View File

@ -13,7 +13,7 @@ crate-type = ["dylib"]
lazy_static = "1.0"
log = "0.4"
env_logger = { version = "0.7", default-features = false }
rustc = { path = "../librustc" }
rustc_middle = { path = "../librustc_middle" }
rustc_ast_pretty = { path = "../librustc_ast_pretty" }
rustc_target = { path = "../librustc_target" }
rustc_lint = { path = "../librustc_lint" }

View File

@ -18,9 +18,6 @@ extern crate lazy_static;
pub extern crate rustc_plugin_impl as plugin;
use rustc::middle::cstore::MetadataLoader;
use rustc::ty::TyCtxt;
use rustc::util::common::ErrorReported;
use rustc_ast::ast;
use rustc_codegen_ssa::{traits::CodegenBackend, CodegenResults};
use rustc_data_structures::profiling::print_time_passes_entry;
@ -35,6 +32,9 @@ use rustc_interface::util::{collect_crate_types, get_builtin_codegen_backend};
use rustc_interface::{interface, Queries};
use rustc_lint::LintStore;
use rustc_metadata::locator;
use rustc_middle::middle::cstore::MetadataLoader;
use rustc_middle::ty::TyCtxt;
use rustc_middle::util::common::ErrorReported;
use rustc_save_analysis as save;
use rustc_save_analysis::DumpHandler;
use rustc_serialize::json::{self, ToJson};

View File

@ -1,13 +1,13 @@
//! The various pretty-printing routines.
use rustc::hir::map as hir_map;
use rustc::ty::{self, TyCtxt};
use rustc::util::common::ErrorReported;
use rustc_ast::ast;
use rustc_ast_pretty::pprust;
use rustc_hir as hir;
use rustc_hir::def_id::LOCAL_CRATE;
use rustc_hir_pretty as pprust_hir;
use rustc_middle::hir::map as hir_map;
use rustc_middle::ty::{self, TyCtxt};
use rustc_middle::util::common::ErrorReported;
use rustc_mir::util::{write_mir_graphviz, write_mir_pretty};
use rustc_session::config::{Input, PpMode, PpSourceMode};
use rustc_session::Session;

View File

@ -12,7 +12,7 @@ extern "C" {
```
A list of available external lang items is available in
`src/librustc/middle/weak_lang_items.rs`. Example:
`src/librustc_middle/middle/weak_lang_items.rs`. Example:
```
#![feature(lang_items)]

View File

@ -425,7 +425,7 @@ impl Handler {
}
// This is here to not allow mutation of flags;
// as of this writing it's only used in tests in librustc.
// as of this writing it's only used in tests in librustc_middle.
pub fn can_emit_warnings(&self) -> bool {
self.flags.can_emit_warnings
}

View File

@ -119,7 +119,7 @@ impl<'a> FnKind<'a> {
}
}
/// An abstract representation of the HIR `rustc::hir::map::Map`.
/// An abstract representation of the HIR `rustc_middle::hir::map::Map`.
pub trait Map<'hir> {
/// Retrieves the `Node` corresponding to `id`, returning `None` if cannot be found.
fn find(&self, hir_id: HirId) -> Option<Node<'hir>>;

View File

@ -9,7 +9,7 @@ use rustc_span::def_id::{DefPathHash, LocalDefId};
/// Requirements for a `StableHashingContext` to be used in this crate.
/// This is a hack to allow using the `HashStable_Generic` derive macro
/// instead of implementing everything in librustc.
/// instead of implementing everything in librustc_middle.
pub trait HashStableContext:
rustc_ast::HashStableContext + rustc_target::HashStableContext
{

View File

@ -13,7 +13,7 @@ doctest = false
graphviz = { path = "../libgraphviz" }
log = "0.4"
rand = "0.7"
rustc = { path = "../librustc" }
rustc_middle = { path = "../librustc_middle" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_hir = { path = "../librustc_hir" }
rustc_serialize = { path = "../libserialize", package = "serialize" }

View File

@ -34,16 +34,16 @@
//! ```
use graphviz as dot;
use rustc::dep_graph::debug::{DepNodeFilter, EdgeFilter};
use rustc::dep_graph::{DepGraphQuery, DepKind, DepNode, DepNodeExt};
use rustc::hir::map::Map;
use rustc::ty::TyCtxt;
use rustc_ast::ast;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::graph::implementation::{Direction, NodeIndex, INCOMING, OUTGOING};
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc_middle::dep_graph::debug::{DepNodeFilter, EdgeFilter};
use rustc_middle::dep_graph::{DepGraphQuery, DepKind, DepNode, DepNodeExt};
use rustc_middle::hir::map::Map;
use rustc_middle::ty::TyCtxt;
use rustc_span::symbol::sym;
use rustc_span::Span;

View File

@ -21,10 +21,10 @@
//! allows for doing a more fine-grained check to see if pre- or post-lto data
//! was re-used.
use rustc::mir::mono::CodegenUnitNameBuilder;
use rustc::ty::TyCtxt;
use rustc_ast::ast;
use rustc_hir::def_id::LOCAL_CRATE;
use rustc_middle::mir::mono::CodegenUnitNameBuilder;
use rustc_middle::ty::TyCtxt;
use rustc_session::cgu_reuse_tracker::*;
use rustc_span::symbol::{sym, Symbol};
use std::collections::BTreeSet;

View File

@ -6,7 +6,7 @@
#![recursion_limit = "256"]
#[macro_use]
extern crate rustc;
extern crate rustc_middle;
#[macro_use]
extern crate log;

View File

@ -1,6 +1,6 @@
//! The data that we will serialize and deserialize.
use rustc::dep_graph::{WorkProduct, WorkProductId};
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
#[derive(Debug, RustcEncodable, RustcDecodable)]
pub struct SerializedWorkProduct {

View File

@ -13,9 +13,6 @@
//! Errors are reported if we are in the suitable configuration but
//! the required condition is not met.
use rustc::dep_graph::{label_strs, DepNode, DepNodeExt};
use rustc::hir::map::Map;
use rustc::ty::TyCtxt;
use rustc_ast::ast::{self, Attribute, NestedMetaItem};
use rustc_data_structures::fingerprint::Fingerprint;
use rustc_data_structures::fx::FxHashSet;
@ -25,6 +22,9 @@ use rustc_hir::intravisit;
use rustc_hir::itemlikevisit::ItemLikeVisitor;
use rustc_hir::Node as HirNode;
use rustc_hir::{ImplItemKind, ItemKind as HirItem, TraitItemKind};
use rustc_middle::dep_graph::{label_strs, DepNode, DepNodeExt};
use rustc_middle::hir::map::Map;
use rustc_middle::ty::TyCtxt;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use std::iter::FromIterator;
@ -306,7 +306,7 @@ impl DirtyCleanVisitor<'tcx> {
// michaelwoerister and vitiral came up with a possible solution,
// to just do this before every query
// ```
// ::rustc::ty::query::plumbing::force_from_dep_node(tcx, dep_node)
// ::rustc_middle::ty::query::plumbing::force_from_dep_node(tcx, dep_node)
// ```
//
// However, this did not seem to work effectively and more bugs were hit.

View File

@ -1,9 +1,9 @@
//! Code to save/load the dep-graph from files.
use rustc::dep_graph::{PreviousDepGraph, SerializedDepGraph, WorkProduct, WorkProductId};
use rustc::ty::query::OnDiskCache;
use rustc::ty::TyCtxt;
use rustc_data_structures::fx::FxHashMap;
use rustc_middle::dep_graph::{PreviousDepGraph, SerializedDepGraph, WorkProduct, WorkProductId};
use rustc_middle::ty::query::OnDiskCache;
use rustc_middle::ty::TyCtxt;
use rustc_serialize::opaque::Decoder;
use rustc_serialize::Decodable as RustcDecodable;
use rustc_session::Session;

View File

@ -1,7 +1,7 @@
use rustc::dep_graph::{DepGraph, DepKind, WorkProduct, WorkProductId};
use rustc::ty::TyCtxt;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::join;
use rustc_middle::dep_graph::{DepGraph, DepKind, WorkProduct, WorkProductId};
use rustc_middle::ty::TyCtxt;
use rustc_serialize::opaque::Encoder;
use rustc_serialize::Encodable as RustcEncodable;
use rustc_session::Session;

View File

@ -1,8 +1,8 @@
//! This module contains files for saving intermediate work-products.
use crate::persist::fs::*;
use rustc::dep_graph::{WorkProduct, WorkProductFileKind, WorkProductId};
use rustc_fs_util::link_or_copy;
use rustc_middle::dep_graph::{WorkProduct, WorkProductFileKind, WorkProductId};
use rustc_session::Session;
use std::fs as std_fs;
use std::path::PathBuf;

View File

@ -12,7 +12,7 @@ doctest = false
[dependencies]
graphviz = { path = "../libgraphviz" }
log = { version = "0.4", features = ["release_max_level_info", "std"] }
rustc = { path = "../librustc" }
rustc_middle = { path = "../librustc_middle" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_errors = { path = "../librustc_errors" }
rustc_hir = { path = "../librustc_hir" }

View File

@ -27,8 +27,8 @@
use super::*;
use rustc::ty::relate::{Relate, TypeRelation};
use rustc::ty::Const;
use rustc_middle::ty::relate::{Relate, TypeRelation};
use rustc_middle::ty::Const;
pub struct At<'a, 'tcx> {
pub infcx: &'a InferCtxt<'a, 'tcx>,

View File

@ -10,10 +10,10 @@ use crate::infer::canonical::{
OriginalQueryValues,
};
use crate::infer::InferCtxt;
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 rustc_middle::ty::flags::FlagComputation;
use rustc_middle::ty::fold::{TypeFoldable, TypeFolder};
use rustc_middle::ty::subst::GenericArg;
use rustc_middle::ty::{self, BoundVar, InferConst, List, Ty, TyCtxt, TypeFlags};
use std::sync::atomic::Ordering;
use rustc_data_structures::fx::FxHashMap;

View File

@ -23,13 +23,13 @@
use crate::infer::{ConstVariableOrigin, ConstVariableOriginKind};
use crate::infer::{InferCtxt, RegionVariableOrigin, TypeVariableOrigin, TypeVariableOriginKind};
use rustc::ty::fold::TypeFoldable;
use rustc::ty::subst::GenericArg;
use rustc::ty::{self, BoundVar, List};
use rustc_index::vec::IndexVec;
use rustc_middle::ty::fold::TypeFoldable;
use rustc_middle::ty::subst::GenericArg;
use rustc_middle::ty::{self, BoundVar, List};
use rustc_span::source_map::Span;
pub use rustc::infer::canonical::*;
pub use rustc_middle::infer::canonical::*;
use substitute::CanonicalExt;
mod canonicalizer;

View File

@ -18,14 +18,14 @@ use crate::infer::{InferCtxt, InferOk, InferResult, NLLRegionVariableOrigin};
use crate::traits::query::{Fallible, NoSolution};
use crate::traits::{DomainGoal, TraitEngine};
use crate::traits::{Obligation, ObligationCause, PredicateObligation};
use rustc::arena::ArenaAllocatable;
use rustc::ty::fold::TypeFoldable;
use rustc::ty::relate::TypeRelation;
use rustc::ty::subst::{GenericArg, GenericArgKind};
use rustc::ty::{self, BoundVar, Ty, TyCtxt};
use rustc_data_structures::captures::Captures;
use rustc_index::vec::Idx;
use rustc_index::vec::IndexVec;
use rustc_middle::arena::ArenaAllocatable;
use rustc_middle::ty::fold::TypeFoldable;
use rustc_middle::ty::relate::TypeRelation;
use rustc_middle::ty::subst::{GenericArg, GenericArgKind};
use rustc_middle::ty::{self, BoundVar, Ty, TyCtxt};
use std::fmt::Debug;
impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {

View File

@ -7,9 +7,9 @@
//! [c]: https://rustc-dev-guide.rust-lang.org/traits/canonicalization.html
use crate::infer::canonical::{Canonical, CanonicalVarValues};
use rustc::ty::fold::TypeFoldable;
use rustc::ty::subst::GenericArgKind;
use rustc::ty::{self, TyCtxt};
use rustc_middle::ty::fold::TypeFoldable;
use rustc_middle::ty::subst::GenericArgKind;
use rustc_middle::ty::{self, TyCtxt};
pub(super) trait CanonicalExt<'tcx, V> {
/// Instantiate the wrapped value, replacing each canonical value

View File

@ -34,13 +34,13 @@ use super::{InferCtxt, MiscVariable, TypeTrace};
use crate::traits::{Obligation, PredicateObligations};
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_ast::ast;
use rustc_hir::def_id::DefId;
use rustc_middle::ty::error::TypeError;
use rustc_middle::ty::relate::{self, Relate, RelateResult, TypeRelation};
use rustc_middle::ty::subst::SubstsRef;
use rustc_middle::ty::{self, InferConst, Ty, TyCtxt};
use rustc_middle::ty::{IntType, UintType};
use rustc_span::{Span, DUMMY_SP};
#[derive(Clone)]

View File

@ -1,10 +1,10 @@
use super::combine::{CombineFields, RelationDir};
use super::Subtype;
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_middle::ty::relate::{self, Relate, RelateResult, TypeRelation};
use rustc_middle::ty::subst::SubstsRef;
use rustc_middle::ty::TyVar;
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_hir::def_id::DefId;

View File

@ -55,19 +55,19 @@ use crate::traits::{
IfExpressionCause, MatchExpressionArmCause, ObligationCause, ObligationCauseCode,
};
use rustc::middle::region;
use rustc::ty::error::TypeError;
use rustc::ty::{
self,
subst::{Subst, SubstsRef},
Region, Ty, TyCtxt, TypeFoldable,
};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_errors::{pluralize, struct_span_err};
use rustc_errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString};
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::Node;
use rustc_middle::middle::region;
use rustc_middle::ty::error::TypeError;
use rustc_middle::ty::{
self,
subst::{Subst, SubstsRef},
Region, Ty, TyCtxt, TypeFoldable,
};
use rustc_span::{DesugaringKind, Pos, Span};
use rustc_target::spec::abi;
use std::{cmp, fmt};

View File

@ -1,13 +1,13 @@
use crate::infer::type_variable::TypeVariableOriginKind;
use crate::infer::InferCtxt;
use rustc::hir::map::Map;
use rustc::ty::print::Print;
use rustc::ty::{self, DefIdTree, Infer, Ty, TyVar};
use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder};
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Namespace};
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc_hir::{Body, Expr, ExprKind, FnRetTy, HirId, Local, Pat};
use rustc_middle::hir::map::Map;
use rustc_middle::ty::print::Print;
use rustc_middle::ty::{self, DefIdTree, Infer, Ty, TyVar};
use rustc_span::source_map::DesugaringKind;
use rustc_span::symbol::kw;
use rustc_span::Span;

View File

@ -5,7 +5,7 @@ use crate::infer::error_reporting::nice_region_error::util::AnonymousParamInfo;
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::infer::lexical_region_resolve::RegionResolutionError;
use crate::infer::SubregionOrigin;
use rustc::util::common::ErrorReported;
use rustc_middle::util::common::ErrorReported;
use rustc_errors::struct_span_err;

View File

@ -1,10 +1,10 @@
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
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;
use rustc_middle::hir::map::Map;
use rustc_middle::middle::resolve_lifetime as rl;
use rustc_middle::ty::{self, Region, TyCtxt};
impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
/// This function calls the `visit_ty` method for the parameters

Some files were not shown because too many files have changed in this diff Show More