Skip to content

Commit

Permalink
Remove trans-internal re-exports of rustc modules
Browse files Browse the repository at this point in the history
The previous commit removed them from the public API, this rewrites the use statements to get rid of the non-standard re-exports.
  • Loading branch information
Robin Kruppe committed May 27, 2017
1 parent 493cd6b commit 6fec17e
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 49 deletions.
20 changes: 9 additions & 11 deletions src/librustc_trans/back/link.rs
Expand Up @@ -14,18 +14,16 @@ use super::rpath::RPathConfig;
use super::rpath;
use super::msvc;
use metadata::METADATA_FILENAME;
use session::config;
use session::config::NoDebugInfo;
use session::config::{OutputFilenames, Input, OutputType};
use session::filesearch;
use session::search_paths::PathKind;
use session::Session;
use middle::cstore::{self, LinkMeta, NativeLibrary, LibSource};
use middle::cstore::{LinkagePreference, NativeLibraryKind};
use middle::dependency_format::Linkage;
use rustc::session::config::{self, NoDebugInfo, OutputFilenames, Input, OutputType};
use rustc::session::filesearch;
use rustc::session::search_paths::PathKind;
use rustc::session::Session;
use rustc::middle::cstore::{self, LinkMeta, NativeLibrary, LibSource, LinkagePreference,
NativeLibraryKind};
use rustc::middle::dependency_format::Linkage;
use CrateTranslation;
use util::common::time;
use util::fs::fix_windows_verbatim_for_gcc;
use rustc::util::common::time;
use rustc::util::fs::fix_windows_verbatim_for_gcc;
use rustc::dep_graph::DepNode;
use rustc::hir::def_id::CrateNum;
use rustc::hir::svh::Svh;
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_trans/back/linker.rs
Expand Up @@ -20,11 +20,11 @@ use context::SharedCrateContext;

use back::archive;
use back::symbol_export::{self, ExportedSymbols};
use middle::dependency_format::Linkage;
use rustc::middle::dependency_format::Linkage;
use rustc::hir::def_id::{LOCAL_CRATE, CrateNum};
use rustc_back::LinkerFlavor;
use session::Session;
use session::config::{self, CrateType, OptLevel, DebugInfoLevel};
use rustc::session::Session;
use rustc::session::config::{self, CrateType, OptLevel, DebugInfoLevel};
use serialize::{json, Encoder};

/// For all the linkers we support, and information they might
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_trans/back/msvc/mod.rs
Expand Up @@ -52,7 +52,7 @@ mod platform {
use std::fs;
use std::path::{Path, PathBuf};
use std::process::Command;
use session::Session;
use rustc::session::Session;
use super::arch::{host_arch, Arch};
use super::registry::LOCAL_MACHINE;

Expand Down Expand Up @@ -296,7 +296,7 @@ mod platform {
mod platform {
use std::path::PathBuf;
use std::process::Command;
use session::Session;
use rustc::session::Session;
pub fn link_exe_cmd(_sess: &Session) -> (Command, Option<PathBuf>) {
(Command::new("link.exe"), None)
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/back/symbol_export.rs
Expand Up @@ -10,7 +10,7 @@

use context::SharedCrateContext;
use monomorphize::Instance;
use util::nodemap::FxHashMap;
use rustc::util::nodemap::FxHashMap;
use rustc::hir::def_id::{DefId, CrateNum, LOCAL_CRATE};
use rustc::session::config;
use rustc::ty::TyCtxt;
Expand Down
11 changes: 5 additions & 6 deletions src/librustc_trans/back/write.rs
Expand Up @@ -12,16 +12,15 @@ use back::lto;
use back::link::{get_linker, remove};
use back::symbol_export::ExportedSymbols;
use rustc_incremental::{save_trans_partition, in_incr_comp_dir};
use session::config::{OutputFilenames, OutputTypes, Passes, SomePasses, AllPasses, Sanitizer};
use session::Session;
use session::config::{self, OutputType};
use rustc::session::config::{self, OutputFilenames, OutputType, OutputTypes, Passes, SomePasses,
AllPasses, Sanitizer};
use rustc::session::Session;
use llvm;
use llvm::{ModuleRef, TargetMachineRef, PassManagerRef, DiagnosticInfoRef, ContextRef};
use llvm::SMDiagnosticRef;
use {CrateTranslation, ModuleLlvm, ModuleSource, ModuleTranslation};
use util::common::{time, time_depth, set_time_depth};
use util::common::path2cstr;
use util::fs::link_or_copy;
use rustc::util::common::{time, time_depth, set_time_depth, path2cstr};
use rustc::util::fs::link_or_copy;
use errors::{self, Handler, Level, DiagnosticBuilder};
use errors::emitter::Emitter;
use syntax_pos::MultiSpan;
Expand Down
10 changes: 5 additions & 5 deletions src/librustc_trans/base.rs
Expand Up @@ -36,16 +36,16 @@ use llvm::{ContextRef, Linkage, ModuleRef, ValueRef, Vector, get_param};
use llvm;
use metadata;
use rustc::hir::def_id::LOCAL_CRATE;
use middle::lang_items::StartFnLangItem;
use middle::cstore::EncodedMetadata;
use rustc::middle::lang_items::StartFnLangItem;
use rustc::middle::cstore::EncodedMetadata;
use rustc::ty::{self, Ty, TyCtxt};
use rustc::dep_graph::AssertDepGraphSafe;
use rustc::middle::cstore::LinkMeta;
use rustc::hir::map as hir_map;
use rustc::util::common::time;
use session::config::{self, NoDebugInfo};
use rustc::session::config::{self, NoDebugInfo};
use rustc::session::{self, DataTypeKind, Session};
use rustc_incremental::IncrementalHashesMap;
use session::{self, DataTypeKind, Session};
use abi;
use mir::lvalue::LvalueRef;
use attributes;
Expand All @@ -71,7 +71,7 @@ use trans_item::{TransItem, DefPathBasedNames};
use type_::Type;
use type_of;
use value::Value;
use util::nodemap::{NodeSet, FxHashMap, FxHashSet};
use rustc::util::nodemap::{NodeSet, FxHashMap, FxHashSet};

use libc::c_uint;
use std::ffi::{CStr, CString};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/collector.rs
Expand Up @@ -204,7 +204,7 @@ use rustc::mir::visit::Visitor as MirVisitor;
use context::SharedCrateContext;
use common::{def_ty, instance_ty};
use monomorphize::{self, Instance};
use util::nodemap::{FxHashSet, FxHashMap, DefIdMap};
use rustc::util::nodemap::{FxHashSet, FxHashMap, DefIdMap};

use trans_item::{TransItem, DefPathBasedNames, InstantiationMode};

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/common.rs
Expand Up @@ -17,7 +17,7 @@ use llvm::{ValueRef, ContextRef, TypeKind};
use llvm::{True, False, Bool, OperandBundleDef};
use rustc::hir::def_id::DefId;
use rustc::hir::map::DefPathData;
use middle::lang_items::LangItem;
use rustc::middle::lang_items::LangItem;
use base;
use builder::Builder;
use consts;
Expand Down
7 changes: 3 additions & 4 deletions src/librustc_trans/context.rs
Expand Up @@ -26,10 +26,9 @@ use rustc_data_structures::base_n;
use rustc::ty::subst::Substs;
use rustc::ty::{self, Ty, TyCtxt};
use rustc::ty::layout::{LayoutTyper, TyLayout};
use session::config::NoDebugInfo;
use session::Session;
use session::config;
use util::nodemap::{NodeSet, DefIdMap, FxHashMap};
use rustc::session::config::{self, NoDebugInfo};
use rustc::session::Session;
use rustc::util::nodemap::{NodeSet, DefIdMap, FxHashMap};

use std::ffi::{CStr, CString};
use std::cell::{Cell, RefCell};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/debuginfo/gdb.rs
Expand Up @@ -16,7 +16,7 @@ use common::{C_bytes, CrateContext, C_i32};
use builder::Builder;
use declare;
use type_::Type;
use session::config::NoDebugInfo;
use rustc::session::config::NoDebugInfo;

use std::ptr;
use syntax::attr;
Expand Down
5 changes: 2 additions & 3 deletions src/librustc_trans/debuginfo/metadata.rs
Expand Up @@ -19,7 +19,6 @@ use super::namespace::mangled_name_of_item;
use super::type_names::compute_debuginfo_type_name;
use super::{CrateDebugContext};
use context::SharedCrateContext;
use session::Session;

use llvm::{self, ValueRef};
use llvm::debuginfo::{DIType, DIFile, DIScope, DIDescriptor,
Expand All @@ -37,8 +36,8 @@ use common::{self, CrateContext};
use type_::Type;
use rustc::ty::{self, AdtKind, Ty};
use rustc::ty::layout::{self, LayoutTyper};
use session::config;
use util::nodemap::FxHashMap;
use rustc::session::{Session, config};
use rustc::util::nodemap::FxHashMap;

use libc::{c_uint, c_longlong};
use std::ffi::CString;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_trans/debuginfo/mod.rs
Expand Up @@ -32,8 +32,8 @@ use builder::Builder;
use monomorphize::Instance;
use rustc::ty::{self, Ty};
use rustc::mir;
use session::config::{self, FullDebugInfo, LimitedDebugInfo, NoDebugInfo};
use util::nodemap::{DefIdMap, FxHashMap, FxHashSet};
use rustc::session::config::{self, FullDebugInfo, LimitedDebugInfo, NoDebugInfo};
use rustc::util::nodemap::{DefIdMap, FxHashMap, FxHashSet};

use libc::c_uint;
use std::cell::{Cell, RefCell};
Expand Down
8 changes: 2 additions & 6 deletions src/librustc_trans/lib.rs
Expand Up @@ -63,10 +63,6 @@ extern crate syntax_pos;
extern crate rustc_errors as errors;
extern crate serialize;

use rustc::session;
use rustc::middle;
use rustc::util;

pub use base::trans_crate;
pub use back::symbol_names::provide;

Expand Down Expand Up @@ -168,8 +164,8 @@ pub struct CrateTranslation {
pub crate_name: Symbol,
pub modules: Vec<ModuleTranslation>,
pub metadata_module: ModuleTranslation,
pub link: middle::cstore::LinkMeta,
pub metadata: middle::cstore::EncodedMetadata,
pub link: rustc::middle::cstore::LinkMeta,
pub metadata: rustc::middle::cstore::EncodedMetadata,
pub exported_symbols: back::symbol_export::ExportedSymbols,
pub no_builtins: bool,
pub windows_subsystem: Option<String>,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/mir/mod.rs
Expand Up @@ -17,7 +17,7 @@ use rustc::mir::{self, Mir};
use rustc::mir::tcx::LvalueTy;
use rustc::ty::subst::Substs;
use rustc::infer::TransNormalize;
use session::config::FullDebugInfo;
use rustc::session::config::FullDebugInfo;
use base;
use builder::Builder;
use common::{self, CrateContext, Funclet};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/mir/rvalue.rs
Expand Up @@ -14,7 +14,7 @@ use rustc::ty::cast::{CastTy, IntTy};
use rustc::ty::layout::{Layout, LayoutTyper};
use rustc::mir::tcx::LvalueTy;
use rustc::mir;
use middle::lang_items::ExchangeMallocFnLangItem;
use rustc::middle::lang_items::ExchangeMallocFnLangItem;

use base;
use builder::Builder;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/partitioning.rs
Expand Up @@ -118,7 +118,7 @@ use std::sync::Arc;
use syntax::ast::NodeId;
use syntax::symbol::{Symbol, InternedString};
use trans_item::{TransItem, InstantiationMode};
use util::nodemap::{FxHashMap, FxHashSet};
use rustc::util::nodemap::{FxHashMap, FxHashSet};

pub enum PartitioningStrategy {
/// Generate one codegen unit per source-level module.
Expand Down

0 comments on commit 6fec17e

Please sign in to comment.