mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc
Remove some imports to the rustc crate - When we have `NestedVisitorMap::None`, we use `type Map = dyn intravisit::Map<'v>;` instead of the actual map. This doesn't actually result in dynamic dispatch (in the future we may want to use an associated type default to simplify the code). - Use `rustc_session::` imports instead of `rustc::{session, lint}`. r? @Zoxc
This commit is contained in:
commit
292c538265
10
Cargo.lock
10
Cargo.lock
@ -3624,6 +3624,7 @@ dependencies = [
|
||||
"rustc_data_structures",
|
||||
"rustc_hir",
|
||||
"rustc_metadata",
|
||||
"rustc_session",
|
||||
"rustc_span",
|
||||
"rustc_target",
|
||||
]
|
||||
@ -3677,6 +3678,7 @@ dependencies = [
|
||||
"rustc_parse",
|
||||
"rustc_plugin_impl",
|
||||
"rustc_save_analysis",
|
||||
"rustc_session",
|
||||
"rustc_span",
|
||||
"rustc_target",
|
||||
"serialize",
|
||||
@ -3791,6 +3793,7 @@ dependencies = [
|
||||
"rustc_hir",
|
||||
"rustc_index",
|
||||
"rustc_macros",
|
||||
"rustc_session",
|
||||
"rustc_span",
|
||||
"rustc_target",
|
||||
"smallvec 1.0.0",
|
||||
@ -3903,6 +3906,7 @@ dependencies = [
|
||||
"rustc_expand",
|
||||
"rustc_hir",
|
||||
"rustc_index",
|
||||
"rustc_session",
|
||||
"rustc_span",
|
||||
"rustc_target",
|
||||
"serialize",
|
||||
@ -3933,6 +3937,7 @@ dependencies = [
|
||||
"rustc_infer",
|
||||
"rustc_lexer",
|
||||
"rustc_macros",
|
||||
"rustc_session",
|
||||
"rustc_span",
|
||||
"rustc_target",
|
||||
"rustc_trait_selection",
|
||||
@ -4013,6 +4018,7 @@ dependencies = [
|
||||
"rustc_hir",
|
||||
"rustc_lint",
|
||||
"rustc_metadata",
|
||||
"rustc_session",
|
||||
"rustc_span",
|
||||
]
|
||||
|
||||
@ -4027,6 +4033,7 @@ dependencies = [
|
||||
"rustc_data_structures",
|
||||
"rustc_errors",
|
||||
"rustc_hir",
|
||||
"rustc_session",
|
||||
"rustc_span",
|
||||
"rustc_typeck",
|
||||
]
|
||||
@ -4068,6 +4075,7 @@ dependencies = [
|
||||
"rustc_data_structures",
|
||||
"rustc_hir",
|
||||
"rustc_parse",
|
||||
"rustc_session",
|
||||
"rustc_span",
|
||||
"serde_json",
|
||||
]
|
||||
@ -4174,6 +4182,7 @@ dependencies = [
|
||||
"rustc_data_structures",
|
||||
"rustc_hir",
|
||||
"rustc_infer",
|
||||
"rustc_session",
|
||||
"rustc_span",
|
||||
"rustc_target",
|
||||
"rustc_trait_selection",
|
||||
@ -4193,6 +4202,7 @@ dependencies = [
|
||||
"rustc_hir",
|
||||
"rustc_index",
|
||||
"rustc_infer",
|
||||
"rustc_session",
|
||||
"rustc_span",
|
||||
"rustc_target",
|
||||
"rustc_trait_selection",
|
||||
|
@ -1,8 +1,6 @@
|
||||
use crate::hir::map::definitions::Definitions;
|
||||
use crate::hir::map::DefPathHash;
|
||||
use crate::hir::map::definitions::{DefPathHash, Definitions};
|
||||
use crate::ich::{self, CachingSourceMapView};
|
||||
use crate::middle::cstore::CrateStore;
|
||||
use crate::session::Session;
|
||||
use crate::ty::{fast_reject, TyCtxt};
|
||||
|
||||
use rustc_ast::ast;
|
||||
@ -11,6 +9,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def_id::{DefId, DefIndex};
|
||||
use rustc_session::Session;
|
||||
use rustc_span::source_map::SourceMap;
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_span::{BytePos, SourceFile};
|
||||
|
@ -83,7 +83,6 @@ pub mod infer;
|
||||
pub mod lint;
|
||||
pub mod middle;
|
||||
pub mod mir;
|
||||
pub use rustc_session as session;
|
||||
pub mod traits;
|
||||
pub mod ty;
|
||||
|
||||
|
@ -5,7 +5,7 @@ use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||
use rustc_errors::{pluralize, Applicability, DiagnosticBuilder, DiagnosticId};
|
||||
use rustc_hir::HirId;
|
||||
pub use rustc_session::lint::{builtin, Level, Lint, LintId, LintPass};
|
||||
use rustc_session::lint::{builtin, Level, Lint, LintId};
|
||||
use rustc_session::{DiagnosticMessageId, Session};
|
||||
use rustc_span::hygiene::MacroKind;
|
||||
use rustc_span::source_map::{DesugaringKind, ExpnKind, MultiSpan};
|
||||
|
@ -2,10 +2,9 @@
|
||||
//! are *mostly* used as a part of that interface, but these should
|
||||
//! probably get a better home if someone can find one.
|
||||
|
||||
use crate::hir::map as hir_map;
|
||||
use crate::hir::map::definitions::{DefKey, DefPathTable};
|
||||
use crate::session::search_paths::PathKind;
|
||||
use crate::session::CrateDisambiguator;
|
||||
pub use self::NativeLibraryKind::*;
|
||||
|
||||
use crate::hir::map::definitions::{DefKey, DefPath, DefPathHash, DefPathTable};
|
||||
use crate::ty::TyCtxt;
|
||||
|
||||
use rustc_ast::ast;
|
||||
@ -14,15 +13,16 @@ use rustc_data_structures::svh::Svh;
|
||||
use rustc_data_structures::sync::{self, MetadataRef};
|
||||
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
|
||||
use rustc_macros::HashStable;
|
||||
use rustc_session::search_paths::PathKind;
|
||||
pub use rustc_session::utils::NativeLibraryKind;
|
||||
use rustc_session::CrateDisambiguator;
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_span::Span;
|
||||
use rustc_target::spec::Target;
|
||||
|
||||
use std::any::Any;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
pub use self::NativeLibraryKind::*;
|
||||
pub use rustc_session::utils::NativeLibraryKind;
|
||||
|
||||
// lonely orphan structs and enums looking for a better home
|
||||
|
||||
/// Where a crate came from on the local filesystem. One of these three options
|
||||
@ -197,8 +197,8 @@ pub trait CrateStore {
|
||||
|
||||
// resolve
|
||||
fn def_key(&self, def: DefId) -> DefKey;
|
||||
fn def_path(&self, def: DefId) -> hir_map::DefPath;
|
||||
fn def_path_hash(&self, def: DefId) -> hir_map::DefPathHash;
|
||||
fn def_path(&self, def: DefId) -> DefPath;
|
||||
fn def_path_hash(&self, def: DefId) -> DefPathHash;
|
||||
fn def_path_table(&self, cnum: CrateNum) -> &DefPathTable;
|
||||
|
||||
// "queries" used in resolve that aren't tracked for incremental compilation
|
||||
|
@ -4,7 +4,7 @@
|
||||
//! For all the gory details, see the provider of the `dependency_formats`
|
||||
//! query.
|
||||
|
||||
use crate::session::config;
|
||||
use rustc_session::config;
|
||||
|
||||
/// A list of dependencies for a certain crate type.
|
||||
///
|
||||
|
@ -5,13 +5,13 @@
|
||||
//! this via an attribute on the crate like `#![recursion_limit="22"]`. This pass
|
||||
//! just peeks and looks for that attribute.
|
||||
|
||||
use crate::session::Session;
|
||||
use core::num::IntErrorKind;
|
||||
use rustc::bug;
|
||||
use rustc_ast::ast;
|
||||
use rustc_data_structures::sync::Once;
|
||||
use rustc_session::Session;
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
|
||||
use rustc_data_structures::sync::Once;
|
||||
use std::num::IntErrorKind;
|
||||
|
||||
pub fn update_limits(sess: &Session, krate: &ast::Crate) {
|
||||
update_limit(sess, krate, &sess.recursion_limit, sym::recursion_limit, 128);
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
pub use self::StabilityLevel::*;
|
||||
|
||||
use crate::session::{DiagnosticMessageId, Session};
|
||||
use crate::ty::{self, TyCtxt};
|
||||
use rustc_ast::ast::CRATE_NODE_ID;
|
||||
use rustc_attr::{self as attr, ConstStability, Deprecation, RustcDeprecation, Stability};
|
||||
@ -17,6 +16,7 @@ use rustc_hir::{self, HirId};
|
||||
use rustc_session::lint::builtin::{DEPRECATED, DEPRECATED_IN_FUTURE, SOFT_UNSTABLE};
|
||||
use rustc_session::lint::{BuiltinLintDiagnostics, Lint, LintBuffer};
|
||||
use rustc_session::parse::feature_err_issue;
|
||||
use rustc_session::{DiagnosticMessageId, Session};
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use rustc_span::{MultiSpan, Span};
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
use crate::dep_graph::{DepConstructor, DepNode, WorkProduct, WorkProductId};
|
||||
use crate::ich::{Fingerprint, NodeIdHashingMode, StableHashingContext};
|
||||
use crate::session::config::OptLevel;
|
||||
use crate::ty::print::obsolete::DefPathBasedNames;
|
||||
use crate::ty::{subst::InternalSubsts, Instance, InstanceDef, SymbolName, TyCtxt};
|
||||
use rustc_attr::InlineAttr;
|
||||
@ -9,6 +8,7 @@ use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
|
||||
use rustc_hir::HirId;
|
||||
use rustc_session::config::OptLevel;
|
||||
use rustc_span::source_map::Span;
|
||||
use rustc_span::symbol::Symbol;
|
||||
use std::fmt;
|
||||
|
@ -1,9 +1,21 @@
|
||||
use crate::session::{self, DataTypeKind};
|
||||
use crate::ich::StableHashingContext;
|
||||
use crate::mir::{GeneratorLayout, GeneratorSavedLocal};
|
||||
use crate::ty::subst::Subst;
|
||||
use crate::ty::{self, subst::SubstsRef, ReprOptions, Ty, TyCtxt, TypeFoldable};
|
||||
|
||||
use rustc_ast::ast::{self, Ident, IntTy, UintTy};
|
||||
use rustc_attr as attr;
|
||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||
use rustc_hir as hir;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_index::vec::{Idx, IndexVec};
|
||||
use rustc_session::{DataTypeKind, FieldInfo, SizeKind, VariantInfo};
|
||||
use rustc_span::DUMMY_SP;
|
||||
use rustc_target::abi::call::{
|
||||
ArgAbi, ArgAttribute, ArgAttributes, Conv, FnAbi, PassMode, Reg, RegKind,
|
||||
};
|
||||
pub use rustc_target::abi::*;
|
||||
use rustc_target::spec::{abi::Abi as SpecAbi, HasTargetSpec};
|
||||
|
||||
use std::cmp;
|
||||
use std::fmt;
|
||||
@ -11,20 +23,6 @@ use std::iter;
|
||||
use std::mem;
|
||||
use std::ops::Bound;
|
||||
|
||||
use crate::ich::StableHashingContext;
|
||||
use crate::mir::{GeneratorLayout, GeneratorSavedLocal};
|
||||
use crate::ty::subst::Subst;
|
||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||
use rustc_hir as hir;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_index::vec::{Idx, IndexVec};
|
||||
|
||||
use rustc_target::abi::call::{
|
||||
ArgAbi, ArgAttribute, ArgAttributes, Conv, FnAbi, PassMode, Reg, RegKind,
|
||||
};
|
||||
pub use rustc_target::abi::*;
|
||||
use rustc_target::spec::{abi::Abi as SpecAbi, HasTargetSpec};
|
||||
|
||||
pub trait IntegerExt {
|
||||
fn to_ty<'tcx>(&self, tcx: TyCtxt<'tcx>, signed: bool) -> Ty<'tcx>;
|
||||
fn from_attr<C: HasDataLayout>(cx: &C, ity: attr::IntType) -> Integer;
|
||||
@ -1651,7 +1649,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
|
||||
if min_size < field_end {
|
||||
min_size = field_end;
|
||||
}
|
||||
session::FieldInfo {
|
||||
FieldInfo {
|
||||
name: name.to_string(),
|
||||
offset: offset.bytes(),
|
||||
size: field_layout.size.bytes(),
|
||||
@ -1661,13 +1659,9 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
|
||||
})
|
||||
.collect();
|
||||
|
||||
session::VariantInfo {
|
||||
VariantInfo {
|
||||
name: n.map(|n| n.to_string()),
|
||||
kind: if layout.is_unsized() {
|
||||
session::SizeKind::Min
|
||||
} else {
|
||||
session::SizeKind::Exact
|
||||
},
|
||||
kind: if layout.is_unsized() { SizeKind::Min } else { SizeKind::Exact },
|
||||
align: layout.align.abi.bytes(),
|
||||
size: if min_size.bytes() == 0 { layout.size.bytes() } else { min_size.bytes() },
|
||||
fields: field_info,
|
||||
|
@ -9,7 +9,6 @@ pub use self::Variance::*;
|
||||
use crate::arena::Arena;
|
||||
use crate::hir::exports::ExportMap;
|
||||
use crate::hir::map as hir_map;
|
||||
|
||||
use crate::ich::Fingerprint;
|
||||
use crate::ich::StableHashingContext;
|
||||
use crate::infer::canonical::Canonical;
|
||||
@ -19,7 +18,6 @@ use crate::middle::resolve_lifetime::ObjectLifetimeDefault;
|
||||
use crate::mir::interpret::ErrorHandled;
|
||||
use crate::mir::GeneratorLayout;
|
||||
use crate::mir::ReadOnlyBodyAndCache;
|
||||
use crate::session::DataTypeKind;
|
||||
use crate::traits::{self, Reveal};
|
||||
use crate::ty;
|
||||
use crate::ty::layout::VariantIdx;
|
||||
@ -42,6 +40,7 @@ use rustc_hir::{Constness, GlobMap, Node, TraitMap};
|
||||
use rustc_index::vec::{Idx, IndexVec};
|
||||
use rustc_macros::HashStable;
|
||||
use rustc_serialize::{self, Encodable, Encoder};
|
||||
use rustc_session::DataTypeKind;
|
||||
use rustc_span::hygiene::ExpnId;
|
||||
use rustc_span::symbol::{kw, sym, Symbol};
|
||||
use rustc_span::Span;
|
||||
|
@ -19,8 +19,6 @@ use crate::mir::interpret::GlobalId;
|
||||
use crate::mir::interpret::{ConstEvalRawResult, ConstEvalResult, ConstValue};
|
||||
use crate::mir::interpret::{LitToConstError, LitToConstInput};
|
||||
use crate::mir::mono::CodegenUnit;
|
||||
use crate::session::config::{EntryFnType, OptLevel, OutputFilenames, SymbolManglingVersion};
|
||||
use crate::session::CrateDisambiguator;
|
||||
use crate::traits::query::{
|
||||
CanonicalPredicateGoal, CanonicalProjectionGoal, CanonicalTyGoal,
|
||||
CanonicalTypeOpAscribeUserTypeGoal, CanonicalTypeOpEqGoal, CanonicalTypeOpNormalizeGoal,
|
||||
@ -49,6 +47,8 @@ use rustc_hir::def::DefKind;
|
||||
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIdSet, DefIndex};
|
||||
use rustc_hir::{Crate, HirIdSet, ItemLocalId, TraitCandidate};
|
||||
use rustc_index::vec::IndexVec;
|
||||
use rustc_session::config::{EntryFnType, OptLevel, OutputFilenames, SymbolManglingVersion};
|
||||
use rustc_session::CrateDisambiguator;
|
||||
use rustc_target::spec::PanicStrategy;
|
||||
|
||||
use rustc_ast::ast;
|
||||
|
@ -3,7 +3,6 @@ use crate::hir::map::definitions::DefPathHash;
|
||||
use crate::ich::{CachingSourceMapView, Fingerprint};
|
||||
use crate::mir::interpret::{AllocDecodingSession, AllocDecodingState};
|
||||
use crate::mir::{self, interpret};
|
||||
use crate::session::{CrateDisambiguator, Session};
|
||||
use crate::ty::codec::{self as ty_codec, TyDecoder, TyEncoder};
|
||||
use crate::ty::context::TyCtxt;
|
||||
use crate::ty::{self, Ty};
|
||||
@ -19,6 +18,7 @@ use rustc_serialize::{
|
||||
opaque, Decodable, Decoder, Encodable, Encoder, SpecializedDecoder, SpecializedEncoder,
|
||||
UseSpecializedDecodable, UseSpecializedEncodable,
|
||||
};
|
||||
use rustc_session::{CrateDisambiguator, Session};
|
||||
use rustc_span::hygiene::{ExpnId, SyntaxContext};
|
||||
use rustc_span::source_map::{SourceMap, StableSourceFileId};
|
||||
use rustc_span::{BytePos, SourceFile, Span, DUMMY_SP};
|
||||
|
@ -37,7 +37,6 @@
|
||||
use rustc::arena::Arena;
|
||||
use rustc::dep_graph::DepGraph;
|
||||
use rustc::hir::map::definitions::{DefKey, DefPathData, Definitions};
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::{bug, span_bug};
|
||||
use rustc_ast::ast;
|
||||
use rustc_ast::ast::*;
|
||||
@ -1463,7 +1462,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
}
|
||||
|
||||
impl<'r, 'a, 'v, 'hir> intravisit::Visitor<'v> for ImplTraitLifetimeCollector<'r, 'a, 'hir> {
|
||||
type Map = Map<'v>;
|
||||
type Map = intravisit::ErasedMap<'v>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
|
||||
intravisit::NestedVisitorMap::None
|
||||
|
@ -1,7 +1,6 @@
|
||||
use super::{AnonymousLifetimeMode, ImplTraitContext, LoweringContext, ParamMode};
|
||||
use super::{GenericArgsCtor, ParenthesizedGenericArgs};
|
||||
|
||||
use rustc::lint::builtin::ELIDED_LIFETIMES_IN_PATHS;
|
||||
use rustc::span_bug;
|
||||
use rustc_ast::ast::{self, *};
|
||||
use rustc_errors::{struct_span_err, Applicability};
|
||||
@ -9,6 +8,7 @@ use rustc_hir as hir;
|
||||
use rustc_hir::def::{DefKind, PartialRes, Res};
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_hir::GenericArg;
|
||||
use rustc_session::lint::builtin::ELIDED_LIFETIMES_IN_PATHS;
|
||||
use rustc_session::lint::BuiltinLintDiagnostics;
|
||||
use rustc_span::Span;
|
||||
|
||||
|
@ -3,8 +3,6 @@
|
||||
use std::ffi::CString;
|
||||
|
||||
use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags;
|
||||
use rustc::session::config::{OptLevel, Sanitizer};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::layout::HasTyCtxt;
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::{self, Ty, TyCtxt};
|
||||
@ -13,6 +11,8 @@ 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_session::config::{OptLevel, Sanitizer};
|
||||
use rustc_session::Session;
|
||||
use rustc_target::abi::call::Conv;
|
||||
use rustc_target::spec::PanicStrategy;
|
||||
|
||||
|
@ -9,9 +9,9 @@ use std::str;
|
||||
|
||||
use crate::llvm::archive_ro::{ArchiveRO, Child};
|
||||
use crate::llvm::{self, ArchiveKind};
|
||||
use rustc::session::Session;
|
||||
use rustc_codegen_ssa::back::archive::{find_library, ArchiveBuilder};
|
||||
use rustc_codegen_ssa::{looks_like_rust_object_file, METADATA_FILENAME, RLIB_BYTECODE_EXTENSION};
|
||||
use rustc_session::Session;
|
||||
use rustc_span::symbol::Symbol;
|
||||
|
||||
struct ArchiveConfig<'a> {
|
||||
|
@ -9,7 +9,6 @@ use log::{debug, info};
|
||||
use rustc::bug;
|
||||
use rustc::dep_graph::WorkProduct;
|
||||
use rustc::middle::exported_symbols::SymbolExportLevel;
|
||||
use rustc::session::config::{self, Lto};
|
||||
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};
|
||||
@ -19,6 +18,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
use rustc_errors::{FatalError, Handler};
|
||||
use rustc_hir::def_id::LOCAL_CRATE;
|
||||
use rustc_session::cgu_reuse_tracker::CguReuse;
|
||||
use rustc_session::config::{self, Lto};
|
||||
|
||||
use std::ffi::{CStr, CString};
|
||||
use std::fs::File;
|
||||
|
@ -15,8 +15,6 @@ use crate::LlvmCodegenBackend;
|
||||
use crate::ModuleLlvm;
|
||||
use log::debug;
|
||||
use rustc::bug;
|
||||
use rustc::session::config::{self, Lto, OutputType, Passes, Sanitizer, SwitchWithOptPath};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_codegen_ssa::back::write::{run_assembler, CodegenContext, ModuleConfig};
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
@ -25,6 +23,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_session::config::{self, Lto, OutputType, Passes, Sanitizer, SwitchWithOptPath};
|
||||
use rustc_session::Session;
|
||||
|
||||
use libc::{c_char, c_int, c_uint, c_void, size_t};
|
||||
use std::ffi::CString;
|
||||
|
@ -28,13 +28,13 @@ 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::session::config::DebugInfo;
|
||||
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_session::config::DebugInfo;
|
||||
use rustc_span::symbol::Symbol;
|
||||
|
||||
use std::ffi::CString;
|
||||
|
@ -7,7 +7,6 @@ use crate::type_of::LayoutLlvmExt;
|
||||
use crate::value::Value;
|
||||
use libc::{c_char, c_uint};
|
||||
use log::debug;
|
||||
use rustc::session::config::{self, Sanitizer};
|
||||
use rustc::ty::layout::{self, Align, Size, TyLayout};
|
||||
use rustc::ty::{self, Ty, TyCtxt};
|
||||
use rustc_codegen_ssa::base::to_immediate;
|
||||
@ -19,6 +18,7 @@ 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_session::config::{self, Sanitizer};
|
||||
use rustc_target::spec::{HasTargetSpec, Target};
|
||||
use std::borrow::Cow;
|
||||
use std::ffi::CStr;
|
||||
|
@ -1,31 +1,30 @@
|
||||
use crate::attributes;
|
||||
use crate::callee::get_fn;
|
||||
use crate::debuginfo;
|
||||
use crate::llvm;
|
||||
use crate::llvm_util;
|
||||
use crate::value::Value;
|
||||
use rustc::dep_graph::DepGraphSafe;
|
||||
|
||||
use crate::type_::Type;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
use crate::value::Value;
|
||||
|
||||
use crate::callee::get_fn;
|
||||
use rustc::bug;
|
||||
use rustc::dep_graph::DepGraphSafe;
|
||||
use rustc::mir::mono::CodegenUnit;
|
||||
use rustc::session::config::{self, CFGuard, DebugInfo};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::layout::{
|
||||
HasParamEnv, LayoutError, LayoutOf, PointeeInfo, Size, TyLayout, 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_target::spec::{HasTargetSpec, Target};
|
||||
|
||||
use rustc_session::config::{self, CFGuard, DebugInfo};
|
||||
use rustc_session::Session;
|
||||
use rustc_span::source_map::{Span, DUMMY_SP};
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_target::spec::{HasTargetSpec, Target};
|
||||
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::ffi::CStr;
|
||||
use std::str;
|
||||
|
@ -6,8 +6,8 @@ use crate::builder::Builder;
|
||||
use crate::common::CodegenCx;
|
||||
use crate::value::Value;
|
||||
use rustc::bug;
|
||||
use rustc::session::config::DebugInfo;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
use rustc_session::config::DebugInfo;
|
||||
|
||||
use rustc_ast::attr;
|
||||
use rustc_span::symbol::sym;
|
||||
|
@ -24,7 +24,6 @@ use rustc::ich::NodeIdHashingMode;
|
||||
use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags;
|
||||
use rustc::mir::interpret::truncate;
|
||||
use rustc::mir::{self, Field, GeneratorLayout};
|
||||
use rustc::session::config::{self, DebugInfo};
|
||||
use rustc::ty::layout::{
|
||||
self, Align, Integer, IntegerExt, LayoutOf, PrimitiveExt, Size, TyLayout, VariantIdx,
|
||||
};
|
||||
@ -42,6 +41,7 @@ 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_session::config::{self, DebugInfo};
|
||||
use rustc_span::symbol::{Interner, Symbol};
|
||||
use rustc_span::{self, FileName, Span};
|
||||
use rustc_target::abi::HasDataLayout;
|
||||
|
@ -20,12 +20,12 @@ use crate::builder::Builder;
|
||||
use crate::common::CodegenCx;
|
||||
use crate::value::Value;
|
||||
use rustc::mir;
|
||||
use rustc::session::config::{self, DebugInfo};
|
||||
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_session::config::{self, DebugInfo};
|
||||
|
||||
use libc::c_uint;
|
||||
use log::debug;
|
||||
|
@ -15,31 +15,30 @@
|
||||
#![recursion_limit = "256"]
|
||||
|
||||
use back::write::{create_informational_target_machine, create_target_machine};
|
||||
use rustc_span::symbol::Symbol;
|
||||
|
||||
pub use llvm_util::target_features;
|
||||
use rustc::dep_graph::WorkProduct;
|
||||
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};
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
use rustc_codegen_ssa::ModuleCodegen;
|
||||
use rustc_codegen_ssa::{CodegenResults, CompiledModule};
|
||||
use rustc_codegen_utils::codegen_backend::CodegenBackend;
|
||||
use rustc_errors::{FatalError, Handler};
|
||||
use rustc_serialize::json;
|
||||
use rustc_session::config::{self, OptLevel, OutputFilenames, PrintRequest};
|
||||
use rustc_session::Session;
|
||||
use rustc_span::symbol::Symbol;
|
||||
|
||||
use std::any::Any;
|
||||
use std::ffi::CStr;
|
||||
use std::fs;
|
||||
use std::sync::Arc;
|
||||
|
||||
use rustc::dep_graph::DepGraph;
|
||||
use rustc::middle::cstore::{EncodedMetadata, MetadataLoaderDyn};
|
||||
use rustc::session::config::{self, OptLevel, OutputFilenames, PrintRequest};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::{self, TyCtxt};
|
||||
use rustc::util::common::ErrorReported;
|
||||
use rustc_codegen_ssa::ModuleCodegen;
|
||||
use rustc_codegen_utils::codegen_backend::CodegenBackend;
|
||||
use rustc_serialize::json;
|
||||
|
||||
mod back {
|
||||
pub mod archive;
|
||||
pub mod bytecode;
|
||||
|
@ -694,8 +694,8 @@ pub mod debuginfo {
|
||||
}
|
||||
|
||||
impl DebugEmissionKind {
|
||||
pub fn from_generic(kind: rustc::session::config::DebugInfo) -> Self {
|
||||
use rustc::session::config::DebugInfo;
|
||||
pub fn from_generic(kind: rustc_session::config::DebugInfo) -> Self {
|
||||
use rustc_session::config::DebugInfo;
|
||||
match kind {
|
||||
DebugInfo::None => DebugEmissionKind::NoDebug,
|
||||
DebugInfo::Limited => DebugEmissionKind::LineTablesOnly,
|
||||
|
@ -2,10 +2,10 @@ use crate::back::write::create_informational_target_machine;
|
||||
use crate::llvm;
|
||||
use libc::c_int;
|
||||
use rustc::bug;
|
||||
use rustc::session::config::PrintRequest;
|
||||
use rustc::session::Session;
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_feature::UnstableFeatures;
|
||||
use rustc_session::config::PrintRequest;
|
||||
use rustc_session::Session;
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_target::spec::{MergeFunctions, PanicStrategy};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use rustc::session::Session;
|
||||
use rustc_session::Session;
|
||||
use rustc_span::symbol::Symbol;
|
||||
|
||||
use std::io;
|
||||
|
@ -1,15 +1,15 @@
|
||||
use rustc::middle::cstore::{EncodedMetadata, LibSource, NativeLibrary, NativeLibraryKind};
|
||||
use rustc::middle::dependency_format::Linkage;
|
||||
use rustc::session::config::{
|
||||
self, CFGuard, DebugInfo, OutputFilenames, OutputType, PrintRequest, Sanitizer,
|
||||
};
|
||||
use rustc::session::search_paths::PathKind;
|
||||
/// For all the linkers we support, and information they might
|
||||
/// need out of the shared crate context before we get rid of it.
|
||||
use rustc::session::{filesearch, Session};
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_fs_util::fix_windows_verbatim_for_gcc;
|
||||
use rustc_hir::def_id::CrateNum;
|
||||
use rustc_session::config::{
|
||||
self, CFGuard, DebugInfo, OutputFilenames, OutputType, PrintRequest, Sanitizer,
|
||||
};
|
||||
use rustc_session::search_paths::PathKind;
|
||||
/// For all the linkers we support, and information they might
|
||||
/// need out of the shared crate context before we get rid of it.
|
||||
use rustc_session::{filesearch, Session};
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_target::spec::{LinkerFlavor, PanicStrategy, RelroLevel};
|
||||
|
||||
|
@ -2,7 +2,6 @@ use super::archive;
|
||||
use super::command::Command;
|
||||
use super::symbol_export;
|
||||
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use std::ffi::{OsStr, OsString};
|
||||
use std::fs::{self, File};
|
||||
use std::io::prelude::*;
|
||||
@ -10,11 +9,12 @@ use std::io::{self, BufWriter};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use rustc::middle::dependency_format::Linkage;
|
||||
use rustc::session::config::{self, CrateType, DebugInfo, LinkerPluginLto, Lto, OptLevel};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
|
||||
use rustc_serialize::{json, Encoder};
|
||||
use rustc_session::config::{self, CrateType, DebugInfo, LinkerPluginLto, Lto, OptLevel};
|
||||
use rustc_session::Session;
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_target::spec::{LinkerFlavor, LldFlavor};
|
||||
|
||||
|
@ -3,7 +3,6 @@ use std::sync::Arc;
|
||||
|
||||
use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags;
|
||||
use rustc::middle::exported_symbols::{metadata_symbol_name, ExportedSymbol, SymbolExportLevel};
|
||||
use rustc::session::config::{self, Sanitizer};
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::subst::{GenericArgKind, SubstsRef};
|
||||
use rustc::ty::Instance;
|
||||
@ -16,6 +15,7 @@ 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_session::config::{self, Sanitizer};
|
||||
|
||||
pub fn threshold(tcx: TyCtxt<'_>) -> SymbolExportLevel {
|
||||
crates_export_threshold(&tcx.sess.crate_types.borrow())
|
||||
|
@ -14,10 +14,6 @@ use jobserver::{Acquired, Client};
|
||||
use rustc::dep_graph::{WorkProduct, WorkProductFileKind, WorkProductId};
|
||||
use rustc::middle::cstore::EncodedMetadata;
|
||||
use rustc::middle::exported_symbols::SymbolExportLevel;
|
||||
use rustc::session::config::{
|
||||
self, Lto, OutputFilenames, OutputType, Passes, Sanitizer, SwitchWithOptPath,
|
||||
};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_ast::attr;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
@ -34,6 +30,10 @@ use rustc_incremental::{
|
||||
copy_cgu_workproducts_to_incr_comp_cache_dir, in_incr_comp_dir, in_incr_comp_dir_sess,
|
||||
};
|
||||
use rustc_session::cgu_reuse_tracker::CguReuseTracker;
|
||||
use rustc_session::config::{
|
||||
self, Lto, OutputFilenames, OutputType, Passes, Sanitizer, SwitchWithOptPath,
|
||||
};
|
||||
use rustc_session::Session;
|
||||
use rustc_span::hygiene::ExpnId;
|
||||
use rustc_span::source_map::SourceMap;
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
|
@ -31,8 +31,6 @@ 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::session::config::{self, EntryFnType, Lto};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::layout::{self, Align, HasTyCtxt, LayoutOf, TyLayout, VariantIdx};
|
||||
use rustc::ty::layout::{FAT_PTR_ADDR, FAT_PTR_EXTRA};
|
||||
use rustc::ty::query::Providers;
|
||||
@ -46,6 +44,8 @@ use rustc_hir as hir;
|
||||
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
|
||||
use rustc_index::vec::Idx;
|
||||
use rustc_session::cgu_reuse_tracker::CguReuse;
|
||||
use rustc_session::config::{self, EntryFnType, Lto};
|
||||
use rustc_session::Session;
|
||||
use rustc_span::Span;
|
||||
|
||||
use std::cmp;
|
||||
|
@ -1,8 +1,8 @@
|
||||
#![allow(non_camel_case_types, non_snake_case)]
|
||||
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::{Ty, TyCtxt};
|
||||
use rustc_errors::struct_span_err;
|
||||
use rustc_session::Session;
|
||||
use rustc_span::Span;
|
||||
|
||||
use crate::base;
|
||||
|
@ -21,12 +21,12 @@ 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::session::config::{OutputFilenames, OutputType, RUST_CGU_EXT};
|
||||
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_session::config::{OutputFilenames, OutputType, RUST_CGU_EXT};
|
||||
use rustc_span::symbol::Symbol;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
use crate::traits::*;
|
||||
use rustc::mir;
|
||||
use rustc::session::config::DebugInfo;
|
||||
use rustc::ty;
|
||||
use rustc::ty::layout::{LayoutOf, Size};
|
||||
use rustc_hir::def_id::CrateNum;
|
||||
use rustc_index::vec::IndexVec;
|
||||
use rustc_session::config::DebugInfo;
|
||||
|
||||
use rustc_span::symbol::{kw, Symbol};
|
||||
use rustc_span::{BytePos, Span};
|
||||
|
@ -3,12 +3,12 @@ use super::CodegenObject;
|
||||
use crate::ModuleCodegen;
|
||||
|
||||
use rustc::middle::cstore::EncodedMetadata;
|
||||
use rustc::session::{config, Session};
|
||||
use rustc::ty::layout::{HasTyCtxt, LayoutOf, TyLayout};
|
||||
use rustc::ty::Ty;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_ast::expand::allocator::AllocatorKind;
|
||||
use rustc_codegen_utils::codegen_backend::CodegenBackend;
|
||||
use rustc_session::{config, Session};
|
||||
use rustc_span::symbol::Symbol;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
@ -1,8 +1,8 @@
|
||||
use super::BackendTypes;
|
||||
use rustc::mir::mono::CodegenUnit;
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::{self, Instance, Ty};
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_session::Session;
|
||||
use std::cell::RefCell;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -21,3 +21,4 @@ rustc_hir = { path = "../librustc_hir" }
|
||||
rustc_target = { path = "../librustc_target" }
|
||||
rustc_data_structures = { path = "../librustc_data_structures" }
|
||||
rustc_metadata = { path = "../librustc_metadata" }
|
||||
rustc_session = { path = "../librustc_session" }
|
||||
|
@ -10,11 +10,11 @@ use std::any::Any;
|
||||
|
||||
use rustc::dep_graph::DepGraph;
|
||||
use rustc::middle::cstore::{EncodedMetadata, MetadataLoaderDyn};
|
||||
use rustc::session::config::{OutputFilenames, PrintRequest};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc::util::common::ErrorReported;
|
||||
use rustc_session::config::{OutputFilenames, PrintRequest};
|
||||
use rustc_session::Session;
|
||||
use rustc_span::symbol::Symbol;
|
||||
|
||||
pub use rustc_data_structures::sync::MetadataRef;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use rustc::session::config::{self, Input, OutputFilenames, OutputType};
|
||||
use rustc::session::Session;
|
||||
use rustc_ast::{ast, attr};
|
||||
use rustc_session::config::{self, Input, OutputFilenames, OutputType};
|
||||
use rustc_session::Session;
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::Span;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
@ -89,12 +89,12 @@
|
||||
|
||||
use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags;
|
||||
use rustc::mir::mono::{InstantiationMode, MonoItem};
|
||||
use rustc::session::config::SymbolManglingVersion;
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::subst::SubstsRef;
|
||||
use rustc::ty::{self, Instance, TyCtxt};
|
||||
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
|
||||
use rustc_hir::Node;
|
||||
use rustc_session::config::SymbolManglingVersion;
|
||||
|
||||
use rustc_span::symbol::Symbol;
|
||||
|
||||
|
@ -33,6 +33,7 @@ rustc_interface = { path = "../librustc_interface" }
|
||||
rustc_serialize = { path = "../libserialize", package = "serialize" }
|
||||
rustc_ast = { path = "../librustc_ast" }
|
||||
rustc_span = { path = "../librustc_span" }
|
||||
rustc_session = { path = "../librustc_session" }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
winapi = { version = "0.3", features = ["consoleapi", "debugapi", "processenv"] }
|
||||
|
@ -18,12 +18,7 @@ extern crate lazy_static;
|
||||
|
||||
pub extern crate rustc_plugin_impl as plugin;
|
||||
|
||||
use rustc::lint::{Lint, LintId};
|
||||
use rustc::middle::cstore::MetadataLoader;
|
||||
use rustc::session::config::nightly_options;
|
||||
use rustc::session::config::{ErrorOutputType, Input, OutputType, PrintRequest};
|
||||
use rustc::session::{config, DiagnosticOutput, Session};
|
||||
use rustc::session::{early_error, early_warn};
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc::util::common::ErrorReported;
|
||||
use rustc_codegen_ssa::CodegenResults;
|
||||
@ -43,6 +38,11 @@ use rustc_metadata::locator;
|
||||
use rustc_save_analysis as save;
|
||||
use rustc_save_analysis::DumpHandler;
|
||||
use rustc_serialize::json::{self, ToJson};
|
||||
use rustc_session::config::nightly_options;
|
||||
use rustc_session::config::{ErrorOutputType, Input, OutputType, PrintRequest};
|
||||
use rustc_session::lint::{Lint, LintId};
|
||||
use rustc_session::{config, DiagnosticOutput, Session};
|
||||
use rustc_session::{early_error, early_warn};
|
||||
|
||||
use std::borrow::Cow;
|
||||
use std::cmp::max;
|
||||
@ -652,7 +652,7 @@ impl RustcDefaultCalls {
|
||||
odir: &Option<PathBuf>,
|
||||
ofile: &Option<PathBuf>,
|
||||
) -> Compilation {
|
||||
use rustc::session::config::PrintRequest::*;
|
||||
use rustc_session::config::PrintRequest::*;
|
||||
// PrintRequest::NativeStaticLibs is special - printed during linking
|
||||
// (empty iterator returns true)
|
||||
if sess.opts.prints.iter().all(|&p| p == PrintRequest::NativeStaticLibs) {
|
||||
|
@ -1,8 +1,6 @@
|
||||
//! The various pretty-printing routines.
|
||||
|
||||
use rustc::hir::map as hir_map;
|
||||
use rustc::session::config::{Input, PpMode, PpSourceMode};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::{self, TyCtxt};
|
||||
use rustc::util::common::ErrorReported;
|
||||
use rustc_ast::ast;
|
||||
@ -11,6 +9,8 @@ use rustc_hir as hir;
|
||||
use rustc_hir::def_id::LOCAL_CRATE;
|
||||
use rustc_hir::print as pprust_hir;
|
||||
use rustc_mir::util::{write_mir_graphviz, write_mir_pretty};
|
||||
use rustc_session::config::{Input, PpMode, PpSourceMode};
|
||||
use rustc_session::Session;
|
||||
use rustc_span::FileName;
|
||||
|
||||
use std::cell::Cell;
|
||||
|
@ -5,7 +5,7 @@
|
||||
//! There are various `Emitter` implementations that generate different output formats such as
|
||||
//! JSON and human readable output.
|
||||
//!
|
||||
//! The output types are defined in `librustc::session::config::ErrorOutputType`.
|
||||
//! The output types are defined in `rustc_session::config::ErrorOutputType`.
|
||||
|
||||
use Destination::*;
|
||||
|
||||
|
@ -127,6 +127,25 @@ pub trait Map<'hir> {
|
||||
fn impl_item(&self, id: ImplItemId) -> &'hir ImplItem<'hir>;
|
||||
}
|
||||
|
||||
/// An erased version of `Map<'hir>`, using dynamic dispatch.
|
||||
/// NOTE: This type is effectively only usable with `NestedVisitorMap::None`.
|
||||
pub struct ErasedMap<'hir>(&'hir dyn Map<'hir>);
|
||||
|
||||
impl<'hir> Map<'hir> for ErasedMap<'hir> {
|
||||
fn body(&self, id: BodyId) -> &'hir Body<'hir> {
|
||||
self.0.body(id)
|
||||
}
|
||||
fn item(&self, id: HirId) -> &'hir Item<'hir> {
|
||||
self.0.item(id)
|
||||
}
|
||||
fn trait_item(&self, id: TraitItemId) -> &'hir TraitItem<'hir> {
|
||||
self.0.trait_item(id)
|
||||
}
|
||||
fn impl_item(&self, id: ImplItemId) -> &'hir ImplItem<'hir> {
|
||||
self.0.impl_item(id)
|
||||
}
|
||||
}
|
||||
|
||||
/// Specifies what nested things a visitor wants to visit. The most
|
||||
/// common choice is `OnlyBodies`, which will cause the visitor to
|
||||
/// visit fn bodies for fns that it encounters, but skip over nested
|
||||
|
@ -14,8 +14,8 @@ use std::fs;
|
||||
use std::io::{self, Read};
|
||||
use std::path::Path;
|
||||
|
||||
use rustc::session::config::nightly_options;
|
||||
use rustc_serialize::opaque::Encoder;
|
||||
use rustc_session::config::nightly_options;
|
||||
|
||||
/// The first few bytes of files generated by incremental compilation.
|
||||
const FILE_MAGIC: &[u8] = b"RSIC";
|
||||
|
@ -103,11 +103,11 @@
|
||||
//! unsupported file system and emit a warning in that case. This is not yet
|
||||
//! implemented.
|
||||
|
||||
use rustc::session::{CrateDisambiguator, Session};
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
use rustc_data_structures::svh::Svh;
|
||||
use rustc_data_structures::{base_n, flock};
|
||||
use rustc_fs_util::{link_or_copy, LinkOrCopy};
|
||||
use rustc_session::{CrateDisambiguator, Session};
|
||||
|
||||
use std::fs as std_fs;
|
||||
use std::io;
|
||||
|
@ -1,12 +1,12 @@
|
||||
//! Code to save/load the dep-graph from files.
|
||||
|
||||
use rustc::dep_graph::{PreviousDepGraph, SerializedDepGraph, WorkProduct, WorkProductId};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::query::OnDiskCache;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_serialize::opaque::Decoder;
|
||||
use rustc_serialize::Decodable as RustcDecodable;
|
||||
use rustc_session::Session;
|
||||
use std::path::Path;
|
||||
|
||||
use super::data::*;
|
||||
|
@ -1,10 +1,10 @@
|
||||
use rustc::dep_graph::{DepGraph, DepKind, WorkProduct, WorkProductId};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_data_structures::sync::join;
|
||||
use rustc_serialize::opaque::Encoder;
|
||||
use rustc_serialize::Encodable as RustcEncodable;
|
||||
use rustc_session::Session;
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
use crate::persist::fs::*;
|
||||
use rustc::dep_graph::{WorkProduct, WorkProductFileKind, WorkProductId};
|
||||
use rustc::session::Session;
|
||||
use rustc_fs_util::link_or_copy;
|
||||
use rustc_session::Session;
|
||||
use std::fs as std_fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
|
@ -18,6 +18,7 @@ rustc_errors = { path = "../librustc_errors" }
|
||||
rustc_hir = { path = "../librustc_hir" }
|
||||
rustc_index = { path = "../librustc_index" }
|
||||
rustc_macros = { path = "../librustc_macros" }
|
||||
rustc_session = { path = "../librustc_session" }
|
||||
rustc_span = { path = "../librustc_span" }
|
||||
rustc_target = { path = "../librustc_target" }
|
||||
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
|
||||
|
@ -5,7 +5,6 @@ pub use self::LateBoundRegionConversionTime::*;
|
||||
pub use self::RegionVariableOrigin::*;
|
||||
pub use self::SubregionOrigin::*;
|
||||
pub use self::ValuePairs::*;
|
||||
pub use rustc::ty::IntVarValue;
|
||||
|
||||
use crate::traits::{self, ObligationCause, PredicateObligations, TraitEngine};
|
||||
|
||||
@ -16,15 +15,14 @@ use rustc::middle::free_region::RegionRelations;
|
||||
use rustc::middle::region;
|
||||
use rustc::mir;
|
||||
use rustc::mir::interpret::ConstEvalResult;
|
||||
use rustc::session::config::BorrowckMode;
|
||||
use rustc::traits::select;
|
||||
use rustc::ty::error::{ExpectedFound, TypeError, UnconstrainedNumeric};
|
||||
use rustc::ty::fold::{TypeFoldable, TypeFolder};
|
||||
use rustc::ty::relate::RelateResult;
|
||||
use rustc::ty::subst::{GenericArg, InternalSubsts, SubstsRef};
|
||||
pub use rustc::ty::IntVarValue;
|
||||
use rustc::ty::{self, GenericParamDefKind, InferConst, Ty, TyCtxt};
|
||||
use rustc::ty::{ConstVid, FloatVid, IntVid, TyVid};
|
||||
|
||||
use rustc_ast::ast;
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
@ -32,8 +30,10 @@ use rustc_data_structures::unify as ut;
|
||||
use rustc_errors::DiagnosticBuilder;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_session::config::BorrowckMode;
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_span::Span;
|
||||
|
||||
use std::cell::{Cell, Ref, RefCell};
|
||||
use std::collections::BTreeMap;
|
||||
use std::fmt;
|
||||
|
@ -1,10 +1,6 @@
|
||||
pub use crate::passes::BoxedResolver;
|
||||
use crate::util;
|
||||
|
||||
use rustc::lint;
|
||||
use rustc::session::config::{self, ErrorOutputType, Input, OutputFilenames};
|
||||
use rustc::session::early_error;
|
||||
use rustc::session::{DiagnosticOutput, Session};
|
||||
use rustc::ty;
|
||||
use rustc::util::common::ErrorReported;
|
||||
use rustc_ast::ast::{self, MetaItemKind};
|
||||
@ -16,7 +12,11 @@ use rustc_data_structures::OnDrop;
|
||||
use rustc_errors::registry::Registry;
|
||||
use rustc_lint::LintStore;
|
||||
use rustc_parse::new_parser_from_source_str;
|
||||
use rustc_session::config::{self, ErrorOutputType, Input, OutputFilenames};
|
||||
use rustc_session::early_error;
|
||||
use rustc_session::lint;
|
||||
use rustc_session::parse::{CrateConfig, ParseSess};
|
||||
use rustc_session::{DiagnosticOutput, Session};
|
||||
use rustc_span::edition;
|
||||
use rustc_span::source_map::{FileLoader, FileName, SourceMap};
|
||||
use std::path::PathBuf;
|
||||
|
@ -6,13 +6,8 @@ use log::{info, log_enabled, warn};
|
||||
use rustc::arena::Arena;
|
||||
use rustc::dep_graph::DepGraph;
|
||||
use rustc::hir::map::Definitions;
|
||||
use rustc::lint;
|
||||
use rustc::middle;
|
||||
use rustc::middle::cstore::{CrateStore, MetadataLoader, MetadataLoaderDyn};
|
||||
use rustc::session::config::{self, CrateType, Input, OutputFilenames, OutputType};
|
||||
use rustc::session::config::{PpMode, PpSourceMode};
|
||||
use rustc::session::search_paths::PathKind;
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::steal::Steal;
|
||||
use rustc::ty::{self, GlobalCtxt, ResolverOutputs, TyCtxt};
|
||||
use rustc::util::common::ErrorReported;
|
||||
@ -34,6 +29,11 @@ use rustc_parse::{parse_crate_from_file, parse_crate_from_source_str};
|
||||
use rustc_passes::{self, hir_stats, layout_test};
|
||||
use rustc_plugin_impl as plugin;
|
||||
use rustc_resolve::{Resolver, ResolverArenas};
|
||||
use rustc_session::config::{self, CrateType, Input, OutputFilenames, OutputType};
|
||||
use rustc_session::config::{PpMode, PpSourceMode};
|
||||
use rustc_session::lint;
|
||||
use rustc_session::search_paths::PathKind;
|
||||
use rustc_session::Session;
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_span::FileName;
|
||||
use rustc_trait_selection::traits;
|
||||
|
@ -3,8 +3,6 @@ use crate::passes::{self, BoxedResolver, QueryContext};
|
||||
|
||||
use rustc::arena::Arena;
|
||||
use rustc::dep_graph::DepGraph;
|
||||
use rustc::session::config::{OutputFilenames, OutputType};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::steal::Steal;
|
||||
use rustc::ty::{GlobalCtxt, ResolverOutputs};
|
||||
use rustc::util::common::ErrorReported;
|
||||
@ -15,6 +13,8 @@ use rustc_hir::def_id::LOCAL_CRATE;
|
||||
use rustc_hir::Crate;
|
||||
use rustc_incremental::DepGraphFuture;
|
||||
use rustc_lint::LintStore;
|
||||
use rustc_session::config::{OutputFilenames, OutputType};
|
||||
use rustc_session::Session;
|
||||
use std::any::Any;
|
||||
use std::cell::{Ref, RefCell, RefMut};
|
||||
use std::mem;
|
||||
|
@ -2,16 +2,16 @@ extern crate getopts;
|
||||
|
||||
use crate::interface::parse_cfgspecs;
|
||||
|
||||
use rustc::lint::Level;
|
||||
use rustc::middle::cstore;
|
||||
use rustc::session::config::{build_configuration, build_session_options, to_crate_config};
|
||||
use rustc::session::config::{rustc_optgroups, ErrorOutputType, ExternLocation, Options, Passes};
|
||||
use rustc::session::config::{ExternEntry, LinkerPluginLto, LtoCli, SwitchWithOptPath};
|
||||
use rustc::session::config::{Externs, OutputType, OutputTypes, SymbolManglingVersion};
|
||||
use rustc::session::search_paths::SearchPath;
|
||||
use rustc::session::{build_session, Session};
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_errors::{emitter::HumanReadableErrorType, registry, ColorConfig};
|
||||
use rustc_session::config::{build_configuration, build_session_options, to_crate_config};
|
||||
use rustc_session::config::{rustc_optgroups, ErrorOutputType, ExternLocation, Options, Passes};
|
||||
use rustc_session::config::{ExternEntry, LinkerPluginLto, LtoCli, SwitchWithOptPath};
|
||||
use rustc_session::config::{Externs, OutputType, OutputTypes, SymbolManglingVersion};
|
||||
use rustc_session::lint::Level;
|
||||
use rustc_session::search_paths::SearchPath;
|
||||
use rustc_session::{build_session, Session};
|
||||
use rustc_span::edition::{Edition, DEFAULT_EDITION};
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_target::spec::{MergeFunctions, PanicStrategy, RelroLevel};
|
||||
|
@ -1,5 +1,4 @@
|
||||
use log::info;
|
||||
use rustc::lint;
|
||||
use rustc::ty;
|
||||
use rustc_ast::ast::{AttrVec, BlockCheckMode};
|
||||
use rustc_ast::mut_visit::{visit_clobber, MutVisitor, *};
|
||||
@ -18,7 +17,7 @@ use rustc_metadata::dynamic_lib::DynamicLibrary;
|
||||
use rustc_resolve::{self, Resolver};
|
||||
use rustc_session as session;
|
||||
use rustc_session::config::{ErrorOutputType, Input, OutputFilenames};
|
||||
use rustc_session::lint::{BuiltinLintDiagnostics, LintBuffer};
|
||||
use rustc_session::lint::{self, BuiltinLintDiagnostics, LintBuffer};
|
||||
use rustc_session::parse::CrateConfig;
|
||||
use rustc_session::CrateDisambiguator;
|
||||
use rustc_session::{config, early_error, filesearch, DiagnosticOutput, Session};
|
||||
|
@ -22,7 +22,6 @@
|
||||
//! `late_lint_methods!` invocation in `lib.rs`.
|
||||
|
||||
use crate::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext};
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::lint::LintDiagnosticBuilder;
|
||||
use rustc::ty::{self, layout::VariantIdx, Ty, TyCtxt};
|
||||
use rustc_ast::ast::{self, Expr};
|
||||
@ -1071,7 +1070,7 @@ impl TypeAliasBounds {
|
||||
err: &'a mut DiagnosticBuilder<'db>,
|
||||
}
|
||||
impl<'a, 'db, 'v> Visitor<'v> for WalkAssocTypes<'a, 'db> {
|
||||
type Map = Map<'v>;
|
||||
type Map = intravisit::ErasedMap<'v>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
|
||||
intravisit::NestedVisitorMap::None
|
||||
|
@ -26,6 +26,7 @@ stable_deref_trait = "1.0.0"
|
||||
rustc_ast = { path = "../librustc_ast" }
|
||||
rustc_expand = { path = "../librustc_expand" }
|
||||
rustc_span = { path = "../librustc_span" }
|
||||
rustc_session = { path = "../librustc_session" }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
winapi = { version = "0.3", features = ["errhandlingapi", "libloaderapi"] }
|
||||
|
@ -6,19 +6,18 @@ use crate::rmeta::{CrateDep, CrateMetadata, CrateNumMap, CrateRoot, MetadataBlob
|
||||
use rustc::hir::map::Definitions;
|
||||
use rustc::middle::cstore::DepKind;
|
||||
use rustc::middle::cstore::{CrateSource, ExternCrate, ExternCrateSource, MetadataLoaderDyn};
|
||||
use rustc::session::config;
|
||||
use rustc::session::search_paths::PathKind;
|
||||
use rustc::session::{CrateDisambiguator, Session};
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_ast::ast;
|
||||
use rustc_ast::attr;
|
||||
use rustc_ast::expand::allocator::{global_allocator_spans, AllocatorKind};
|
||||
use rustc_ast::{ast, attr};
|
||||
use rustc_data_structures::svh::Svh;
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
use rustc_errors::struct_span_err;
|
||||
use rustc_expand::base::SyntaxExtension;
|
||||
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
|
||||
use rustc_index::vec::IndexVec;
|
||||
use rustc_session::config;
|
||||
use rustc_session::search_paths::PathKind;
|
||||
use rustc_session::{CrateDisambiguator, Session};
|
||||
use rustc_span::edition::Edition;
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use rustc_span::{Span, DUMMY_SP};
|
||||
|
@ -56,10 +56,10 @@ use crate::creader::CStore;
|
||||
use rustc::middle::cstore::LinkagePreference::{self, RequireDynamic, RequireStatic};
|
||||
use rustc::middle::cstore::{self, DepKind};
|
||||
use rustc::middle::dependency_format::{Dependencies, DependencyList, Linkage};
|
||||
use rustc::session::config;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_hir::def_id::CrateNum;
|
||||
use rustc_session::config;
|
||||
use rustc_target::spec::PanicStrategy;
|
||||
|
||||
crate fn calculate(tcx: TyCtxt<'_>) -> Dependencies {
|
||||
|
@ -31,7 +31,7 @@ pub mod dynamic_lib;
|
||||
pub mod locator;
|
||||
|
||||
pub fn validate_crate_name(
|
||||
sess: Option<&rustc::session::Session>,
|
||||
sess: Option<&rustc_session::Session>,
|
||||
s: &str,
|
||||
sp: Option<rustc_span::Span>,
|
||||
) {
|
||||
|
@ -216,13 +216,13 @@ use crate::creader::Library;
|
||||
use crate::rmeta::{rustc_version, MetadataBlob, METADATA_HEADER};
|
||||
|
||||
use rustc::middle::cstore::{CrateSource, MetadataLoader};
|
||||
use rustc::session::filesearch::{FileDoesntMatch, FileMatches, FileSearch};
|
||||
use rustc::session::search_paths::PathKind;
|
||||
use rustc::session::{config, CrateDisambiguator, Session};
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
use rustc_data_structures::svh::Svh;
|
||||
use rustc_data_structures::sync::MetadataRef;
|
||||
use rustc_errors::{struct_span_err, DiagnosticBuilder};
|
||||
use rustc_session::filesearch::{FileDoesntMatch, FileMatches, FileSearch};
|
||||
use rustc_session::search_paths::PathKind;
|
||||
use rustc_session::{config, CrateDisambiguator, Session};
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use rustc_span::Span;
|
||||
use rustc_target::spec::{Target, TargetTriple};
|
||||
|
@ -1,12 +1,12 @@
|
||||
use rustc::middle::cstore::{self, NativeLibrary};
|
||||
use rustc::session::parse::feature_err;
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_attr as attr;
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_errors::struct_span_err;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::itemlikevisit::ItemLikeVisitor;
|
||||
use rustc_session::parse::feature_err;
|
||||
use rustc_session::Session;
|
||||
use rustc_span::source_map::Span;
|
||||
use rustc_span::symbol::{kw, sym, Symbol};
|
||||
use rustc_target::spec::abi::Abi;
|
||||
|
@ -14,36 +14,35 @@ use rustc::middle::exported_symbols::{ExportedSymbol, SymbolExportLevel};
|
||||
use rustc::middle::lang_items;
|
||||
use rustc::mir::interpret::{AllocDecodingSession, AllocDecodingState};
|
||||
use rustc::mir::{self, interpret, BodyAndCache, Promoted};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::codec::TyDecoder;
|
||||
use rustc::ty::{self, Ty, TyCtxt};
|
||||
use rustc::util::common::record_time;
|
||||
use rustc_ast::ast::{self, Ident};
|
||||
use rustc_attr as attr;
|
||||
use rustc_data_structures::captures::Captures;
|
||||
use rustc_data_structures::fingerprint::Fingerprint;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_data_structures::svh::Svh;
|
||||
use rustc_data_structures::sync::{AtomicCell, Lock, LockGuard, Lrc, Once};
|
||||
use rustc_expand::base::{SyntaxExtension, SyntaxExtensionKind};
|
||||
use rustc_expand::proc_macro::{AttrProcMacro, BangProcMacro, ProcMacroDerive};
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
|
||||
use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
|
||||
use rustc_index::vec::{Idx, IndexVec};
|
||||
use rustc_serialize::{opaque, Decodable, Decoder, SpecializedDecoder};
|
||||
use rustc_session::Session;
|
||||
use rustc_span::source_map::{self, respan, Spanned};
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use rustc_span::{self, hygiene::MacroKind, BytePos, Pos, Span, DUMMY_SP};
|
||||
|
||||
use log::debug;
|
||||
use proc_macro::bridge::client::ProcMacro;
|
||||
use std::io;
|
||||
use std::mem;
|
||||
use std::num::NonZeroUsize;
|
||||
use std::u32;
|
||||
|
||||
use log::debug;
|
||||
use proc_macro::bridge::client::ProcMacro;
|
||||
use rustc_ast::ast::{self, Ident};
|
||||
use rustc_attr as attr;
|
||||
use rustc_expand::base::{SyntaxExtension, SyntaxExtensionKind};
|
||||
use rustc_expand::proc_macro::{AttrProcMacro, BangProcMacro, ProcMacroDerive};
|
||||
use rustc_serialize::{opaque, Decodable, Decoder, SpecializedDecoder};
|
||||
use rustc_span::source_map::{self, respan, Spanned};
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use rustc_span::{self, hygiene::MacroKind, BytePos, Pos, Span, DUMMY_SP};
|
||||
|
||||
pub use cstore_impl::{provide, provide_extern};
|
||||
|
||||
mod cstore_impl;
|
||||
|
@ -10,7 +10,6 @@ use rustc::hir::map::{DefKey, DefPath, DefPathHash};
|
||||
use rustc::middle::cstore::{CrateSource, CrateStore, EncodedMetadata, NativeLibraryKind};
|
||||
use rustc::middle::exported_symbols::ExportedSymbol;
|
||||
use rustc::middle::stability::DeprecationEntry;
|
||||
use rustc::session::{CrateDisambiguator, Session};
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::query::QueryConfig;
|
||||
use rustc::ty::{self, TyCtxt};
|
||||
@ -20,6 +19,7 @@ use rustc_ast::expand::allocator::AllocatorKind;
|
||||
use rustc_data_structures::svh::Svh;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, CRATE_DEF_INDEX, LOCAL_CRATE};
|
||||
use rustc_session::{CrateDisambiguator, Session};
|
||||
use rustc_span::source_map::{self, Span, Spanned};
|
||||
use rustc_span::symbol::Symbol;
|
||||
|
||||
|
@ -12,33 +12,31 @@ use rustc::traits::specialization_graph;
|
||||
use rustc::ty::codec::{self as ty_codec, TyEncoder};
|
||||
use rustc::ty::layout::VariantIdx;
|
||||
use rustc::ty::{self, SymbolName, Ty, TyCtxt};
|
||||
use rustc_ast::ast;
|
||||
use rustc_ast::attr;
|
||||
use rustc_data_structures::fingerprint::Fingerprint;
|
||||
use rustc_hir::def::CtorKind;
|
||||
use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
|
||||
use rustc_hir::{AnonConst, GenericParamKind};
|
||||
use rustc_index::vec::Idx;
|
||||
|
||||
use rustc::session::config::{self, CrateType};
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_data_structures::stable_hasher::StableHasher;
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def::CtorKind;
|
||||
use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
|
||||
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
|
||||
use rustc_hir::itemlikevisit::ItemLikeVisitor;
|
||||
use rustc_hir::{AnonConst, GenericParamKind};
|
||||
use rustc_index::vec::Idx;
|
||||
use rustc_serialize::{opaque, Encodable, Encoder, SpecializedEncoder};
|
||||
|
||||
use log::{debug, trace};
|
||||
use rustc_ast::ast;
|
||||
use rustc_ast::attr;
|
||||
use rustc_session::config::{self, CrateType};
|
||||
use rustc_span::source_map::Spanned;
|
||||
use rustc_span::symbol::{kw, sym, Ident, Symbol};
|
||||
use rustc_span::{self, FileName, SourceFile, Span};
|
||||
|
||||
use log::{debug, trace};
|
||||
use std::hash::Hash;
|
||||
use std::num::NonZeroUsize;
|
||||
use std::path::Path;
|
||||
use std::u32;
|
||||
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
|
||||
use rustc_hir::itemlikevisit::ItemLikeVisitor;
|
||||
|
||||
struct EncodeContext<'tcx> {
|
||||
opaque: opaque::Encoder,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
|
@ -7,8 +7,6 @@ use rustc::middle::cstore::{DepKind, ForeignModule, LinkagePreference, NativeLib
|
||||
use rustc::middle::exported_symbols::{ExportedSymbol, SymbolExportLevel};
|
||||
use rustc::middle::lang_items;
|
||||
use rustc::mir;
|
||||
use rustc::session::config::SymbolManglingVersion;
|
||||
use rustc::session::CrateDisambiguator;
|
||||
use rustc::ty::{self, ReprOptions, Ty};
|
||||
use rustc_ast::ast::{self, MacroDef};
|
||||
use rustc_attr as attr;
|
||||
@ -19,6 +17,8 @@ use rustc_hir::def::CtorKind;
|
||||
use rustc_hir::def_id::{DefId, DefIndex};
|
||||
use rustc_index::vec::IndexVec;
|
||||
use rustc_serialize::opaque::Encoder;
|
||||
use rustc_session::config::SymbolManglingVersion;
|
||||
use rustc_session::CrateDisambiguator;
|
||||
use rustc_span::edition::Edition;
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_span::{self, Span};
|
||||
|
@ -27,6 +27,7 @@ rustc_infer = { path = "../librustc_infer" }
|
||||
rustc_lexer = { path = "../librustc_lexer" }
|
||||
rustc_macros = { path = "../librustc_macros" }
|
||||
rustc_serialize = { path = "../libserialize", package = "serialize" }
|
||||
rustc_session = { path = "../librustc_session" }
|
||||
rustc_target = { path = "../librustc_target" }
|
||||
rustc_trait_selection = { path = "../librustc_trait_selection" }
|
||||
rustc_ast = { path = "../librustc_ast" }
|
||||
|
@ -1,7 +1,5 @@
|
||||
//! This query borrow-checks the MIR to (further) ensure it is not broken.
|
||||
|
||||
use rustc::lint::builtin::MUTABLE_BORROW_RESERVATION_CONFLICT;
|
||||
use rustc::lint::builtin::UNUSED_MUT;
|
||||
use rustc::mir::{
|
||||
read_only, traversal, Body, BodyAndCache, ClearCrossCrate, Local, Location, Mutability,
|
||||
Operand, Place, PlaceElem, PlaceRef, ReadOnlyBodyAndCache,
|
||||
@ -11,7 +9,7 @@ use rustc::mir::{Field, ProjectionElem, Promoted, Rvalue, Statement, StatementKi
|
||||
use rustc::mir::{Terminator, TerminatorKind};
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::{self, RegionVid, TyCtxt};
|
||||
|
||||
use rustc_ast::ast::Name;
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
use rustc_data_structures::graph::dominators::Dominators;
|
||||
use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder};
|
||||
@ -20,6 +18,8 @@ use rustc_hir::{def_id::DefId, HirId, Node};
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_index::vec::IndexVec;
|
||||
use rustc_infer::infer::{InferCtxt, TyCtxtInferExt};
|
||||
use rustc_session::lint::builtin::{MUTABLE_BORROW_RESERVATION_CONFLICT, UNUSED_MUT};
|
||||
use rustc_span::{Span, DUMMY_SP};
|
||||
|
||||
use either::Either;
|
||||
use smallvec::SmallVec;
|
||||
@ -28,9 +28,6 @@ use std::collections::BTreeMap;
|
||||
use std::mem;
|
||||
use std::rc::Rc;
|
||||
|
||||
use rustc_ast::ast::Name;
|
||||
use rustc_span::{Span, DUMMY_SP};
|
||||
|
||||
use crate::dataflow;
|
||||
use crate::dataflow::generic::{Analysis, BorrowckFlowState as Flows, BorrowckResults};
|
||||
use crate::dataflow::indexes::{BorrowIndex, InitIndex, MoveOutIndex, MovePathIndex};
|
||||
|
@ -1,16 +1,14 @@
|
||||
use rustc_ast::ast::{self, MetaItem};
|
||||
use rustc_ast_pretty::pprust;
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
|
||||
use rustc_data_structures::work_queue::WorkQueue;
|
||||
use rustc_index::bit_set::{BitSet, HybridBitSet};
|
||||
use rustc_index::vec::Idx;
|
||||
|
||||
use rustc::mir::traversal;
|
||||
use rustc::mir::{self, BasicBlock, BasicBlockData, Body, Location, Statement, Terminator};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::{self, TyCtxt};
|
||||
use rustc_ast::ast::{self, MetaItem};
|
||||
use rustc_ast_pretty::pprust;
|
||||
use rustc_data_structures::work_queue::WorkQueue;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_index::bit_set::{BitSet, HybridBitSet};
|
||||
use rustc_index::vec::Idx;
|
||||
use rustc_session::Session;
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
|
||||
use std::borrow::Borrow;
|
||||
use std::fmt;
|
||||
|
@ -183,7 +183,6 @@ use rustc::mir::interpret::{ErrorHandled, GlobalAlloc, Scalar};
|
||||
use rustc::mir::mono::{InstantiationMode, MonoItem};
|
||||
use rustc::mir::visit::Visitor as MirVisitor;
|
||||
use rustc::mir::{self, Local, Location};
|
||||
use rustc::session::config::EntryFnType;
|
||||
use rustc::ty::adjustment::{CustomCoerceUnsized, PointerCast};
|
||||
use rustc::ty::print::obsolete::DefPathBasedNames;
|
||||
use rustc::ty::subst::{InternalSubsts, SubstsRef};
|
||||
@ -194,6 +193,7 @@ use rustc_hir as hir;
|
||||
use rustc_hir::def_id::{DefId, DefIdMap, LOCAL_CRATE};
|
||||
use rustc_hir::itemlikevisit::ItemLikeVisitor;
|
||||
use rustc_index::bit_set::GrowableBitSet;
|
||||
use rustc_session::config::EntryFnType;
|
||||
use smallvec::SmallVec;
|
||||
use std::iter;
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
//! Concrete error types for all operations which may be invalid in a certain const context.
|
||||
|
||||
use rustc::session::config::nightly_options;
|
||||
use rustc::session::parse::feature_err;
|
||||
use rustc_errors::struct_span_err;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_session::config::nightly_options;
|
||||
use rustc_session::parse::feature_err;
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::{Span, Symbol};
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::lint::builtin::{SAFE_PACKED_BORROWS, UNUSED_UNSAFE};
|
||||
use rustc::mir::visit::{MutatingUseContext, PlaceContext, Visitor};
|
||||
use rustc::mir::*;
|
||||
use rustc::ty::cast::CastTy;
|
||||
@ -11,6 +9,7 @@ use rustc_hir as hir;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_hir::intravisit;
|
||||
use rustc_hir::Node;
|
||||
use rustc_session::lint::builtin::{SAFE_PACKED_BORROWS, UNUSED_UNSAFE};
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
|
||||
use std::ops::Bound;
|
||||
@ -451,7 +450,7 @@ struct UnusedUnsafeVisitor<'a> {
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> intravisit::Visitor<'tcx> for UnusedUnsafeVisitor<'a> {
|
||||
type Map = Map<'tcx>;
|
||||
type Map = intravisit::ErasedMap<'tcx>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
|
||||
intravisit::NestedVisitorMap::None
|
||||
|
@ -4,7 +4,6 @@
|
||||
use std::borrow::Cow;
|
||||
use std::cell::Cell;
|
||||
|
||||
use rustc::lint;
|
||||
use rustc::mir::interpret::{InterpResult, Scalar};
|
||||
use rustc::mir::visit::{
|
||||
MutVisitor, MutatingUseContext, NonMutatingUseContext, PlaceContext, Visitor,
|
||||
@ -25,6 +24,7 @@ use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_hir::def::DefKind;
|
||||
use rustc_hir::HirId;
|
||||
use rustc_index::vec::IndexVec;
|
||||
use rustc_session::lint;
|
||||
use rustc_span::Span;
|
||||
use rustc_trait_selection::traits;
|
||||
|
||||
|
@ -8,8 +8,8 @@ use std::io;
|
||||
use crate::transform::{MirPass, MirSource};
|
||||
use crate::util as mir_util;
|
||||
use rustc::mir::{Body, BodyAndCache};
|
||||
use rustc::session::config::{OutputFilenames, OutputType};
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_session::config::{OutputFilenames, OutputType};
|
||||
|
||||
pub struct Marker(pub &'static str);
|
||||
|
||||
|
@ -1,25 +1,22 @@
|
||||
//! Inlining pass for MIR functions
|
||||
|
||||
use rustc_hir::def_id::DefId;
|
||||
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_index::vec::{Idx, IndexVec};
|
||||
|
||||
use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags;
|
||||
use rustc::mir::visit::*;
|
||||
use rustc::mir::*;
|
||||
use rustc::session::config::Sanitizer;
|
||||
use rustc::ty::subst::{InternalSubsts, Subst, SubstsRef};
|
||||
use rustc::ty::{self, Instance, InstanceDef, ParamEnv, Ty, TyCtxt, TypeFoldable};
|
||||
use rustc_attr as attr;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_index::vec::{Idx, IndexVec};
|
||||
use rustc_session::config::Sanitizer;
|
||||
use rustc_target::spec::abi::Abi;
|
||||
|
||||
use super::simplify::{remove_dead_blocks, CfgSimplifier};
|
||||
use crate::transform::{MirPass, MirSource};
|
||||
use std::collections::VecDeque;
|
||||
use std::iter;
|
||||
|
||||
use rustc_attr as attr;
|
||||
use rustc_target::spec::abi::Abi;
|
||||
|
||||
const DEFAULT_THRESHOLD: usize = 50;
|
||||
const HINT_THRESHOLD: usize = 100;
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
use crate::{shim, util};
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::mir::{BodyAndCache, ConstQualifs, MirPhase, Promoted};
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::steal::Steal;
|
||||
@ -86,7 +85,7 @@ fn mir_keys(tcx: TyCtxt<'_>, krate: CrateNum) -> &DefIdSet {
|
||||
}
|
||||
intravisit::walk_struct_def(self, v)
|
||||
}
|
||||
type Map = Map<'tcx>;
|
||||
type Map = intravisit::ErasedMap<'tcx>;
|
||||
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
|
||||
NestedVisitorMap::None
|
||||
}
|
||||
|
@ -235,17 +235,15 @@ use rustc_index::vec::Idx;
|
||||
use super::{compare_const_vals, PatternFoldable, PatternFolder};
|
||||
use super::{FieldPat, Pat, PatKind, PatRange};
|
||||
|
||||
use rustc::ty::layout::{Integer, IntegerExt, Size, VariantIdx};
|
||||
use rustc::ty::{self, Const, Ty, TyCtxt, TypeFoldable, VariantDef};
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_hir::{HirId, RangeEnd};
|
||||
|
||||
use rustc::lint;
|
||||
use rustc::mir::interpret::{truncate, AllocId, ConstValue, Pointer, Scalar};
|
||||
use rustc::mir::Field;
|
||||
use rustc::ty::layout::{Integer, IntegerExt, Size, VariantIdx};
|
||||
use rustc::ty::{self, Const, Ty, TyCtxt, TypeFoldable, VariantDef};
|
||||
use rustc::util::common::ErrorReported;
|
||||
|
||||
use rustc_attr::{SignedInt, UnsignedInt};
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_hir::{HirId, RangeEnd};
|
||||
use rustc_session::lint;
|
||||
use rustc_span::{Span, DUMMY_SP};
|
||||
|
||||
use arena::TypedArena;
|
||||
|
@ -4,7 +4,6 @@ use super::_match::{expand_pattern, is_useful, MatchCheckCtxt, Matrix, PatStack}
|
||||
|
||||
use super::{PatCtxt, PatKind, PatternError};
|
||||
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::ty::{self, Ty, TyCtxt};
|
||||
use rustc_ast::ast::Mutability;
|
||||
use rustc_errors::{error_code, struct_span_err, Applicability, DiagnosticBuilder};
|
||||
@ -43,7 +42,7 @@ struct MatchVisitor<'a, 'tcx> {
|
||||
}
|
||||
|
||||
impl<'tcx> Visitor<'tcx> for MatchVisitor<'_, 'tcx> {
|
||||
type Map = Map<'tcx>;
|
||||
type Map = intravisit::ErasedMap<'tcx>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
|
||||
NestedVisitorMap::None
|
||||
@ -753,7 +752,7 @@ fn check_legality_of_bindings_in_at_patterns(cx: &MatchVisitor<'_, '_>, pat: &Pa
|
||||
}
|
||||
|
||||
impl<'v> Visitor<'v> for AtBindingPatternVisitor<'_, '_, '_> {
|
||||
type Map = Map<'v>;
|
||||
type Map = intravisit::ErasedMap<'v>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
|
||||
NestedVisitorMap::None
|
||||
|
@ -1,16 +1,14 @@
|
||||
use rustc::lint;
|
||||
use rustc::mir::Field;
|
||||
use rustc::ty::{self, Ty, TyCtxt};
|
||||
use rustc_hir as hir;
|
||||
use rustc_index::vec::Idx;
|
||||
use rustc_infer::infer::{InferCtxt, TyCtxtInferExt};
|
||||
use rustc_session::lint;
|
||||
use rustc_span::Span;
|
||||
use rustc_trait_selection::traits::predicate_for_trait_def;
|
||||
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;
|
||||
use rustc_trait_selection::traits::{self, ObligationCause, PredicateObligation};
|
||||
|
||||
use rustc_index::vec::Idx;
|
||||
|
||||
use rustc_span::Span;
|
||||
|
||||
use std::cell::Cell;
|
||||
|
||||
use super::{FieldPat, Pat, PatCtxt, PatKind};
|
||||
@ -182,7 +180,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
|
||||
let kind = match cv.ty.kind {
|
||||
ty::Float(_) => {
|
||||
tcx.struct_span_lint_hir(
|
||||
::rustc::lint::builtin::ILLEGAL_FLOATING_POINT_LITERAL_PATTERN,
|
||||
lint::builtin::ILLEGAL_FLOATING_POINT_LITERAL_PATTERN,
|
||||
id,
|
||||
span,
|
||||
|lint| lint.build("floating-point types cannot be used in patterns").emit(),
|
||||
|
@ -1,11 +1,11 @@
|
||||
use rustc::hir::map::blocks::FnLikeNode;
|
||||
use rustc::lint::builtin::UNCONDITIONAL_RECURSION;
|
||||
use rustc::mir::{self, Body, TerminatorKind};
|
||||
use rustc::ty::subst::InternalSubsts;
|
||||
use rustc::ty::{self, AssocItem, AssocItemContainer, Instance, TyCtxt};
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_hir::intravisit::FnKind;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_session::lint::builtin::UNCONDITIONAL_RECURSION;
|
||||
|
||||
crate fn check<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, def_id: DefId) {
|
||||
let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
|
||||
|
@ -8,8 +8,6 @@
|
||||
//! through, but errors for structured control flow in a `const` should be emitted here.
|
||||
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::session::config::nightly_options;
|
||||
use rustc::session::parse::feature_err;
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_ast::ast::Mutability;
|
||||
@ -17,6 +15,8 @@ use rustc_errors::struct_span_err;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
|
||||
use rustc_session::config::nightly_options;
|
||||
use rustc_session::parse::feature_err;
|
||||
use rustc_span::{sym, Span, Symbol};
|
||||
|
||||
use std::fmt;
|
||||
|
@ -210,7 +210,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
|
||||
type Map = Map<'tcx>;
|
||||
type Map = intravisit::ErasedMap<'tcx>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
|
||||
NestedVisitorMap::None
|
||||
|
@ -1,6 +1,4 @@
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::session::config::EntryFnType;
|
||||
use rustc::session::{config, Session};
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_ast::attr;
|
||||
@ -9,6 +7,8 @@ use rustc_errors::struct_span_err;
|
||||
use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
|
||||
use rustc_hir::itemlikevisit::ItemLikeVisitor;
|
||||
use rustc_hir::{HirId, ImplItem, Item, ItemKind, TraitItem};
|
||||
use rustc_session::config::EntryFnType;
|
||||
use rustc_session::{config, Session};
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::{Span, DUMMY_SP};
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::ty::layout::{LayoutError, Pointer, SizeSkeleton, VariantIdx};
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::{self, Ty, TyCtxt};
|
||||
@ -122,7 +121,7 @@ impl ExprVisitor<'tcx> {
|
||||
}
|
||||
|
||||
impl Visitor<'tcx> for ItemVisitor<'tcx> {
|
||||
type Map = Map<'tcx>;
|
||||
type Map = intravisit::ErasedMap<'tcx>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
|
||||
NestedVisitorMap::None
|
||||
@ -139,7 +138,7 @@ impl Visitor<'tcx> for ItemVisitor<'tcx> {
|
||||
}
|
||||
|
||||
impl Visitor<'tcx> for ExprVisitor<'tcx> {
|
||||
type Map = Map<'tcx>;
|
||||
type Map = intravisit::ErasedMap<'tcx>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
|
||||
NestedVisitorMap::None
|
||||
|
@ -97,7 +97,6 @@ use self::LiveNodeKind::*;
|
||||
use self::VarKind::*;
|
||||
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::lint;
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::{self, TyCtxt};
|
||||
use rustc_ast::ast;
|
||||
@ -108,6 +107,7 @@ use rustc_hir::def::*;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_hir::intravisit::{self, FnKind, NestedVisitorMap, Visitor};
|
||||
use rustc_hir::{Expr, HirId, HirIdMap, HirIdSet, Node};
|
||||
use rustc_session::lint;
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::Span;
|
||||
|
||||
@ -1370,7 +1370,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
|
||||
// Checking for error conditions
|
||||
|
||||
impl<'a, 'tcx> Visitor<'tcx> for Liveness<'a, 'tcx> {
|
||||
type Map = Map<'tcx>;
|
||||
type Map = intravisit::ErasedMap<'tcx>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
|
||||
NestedVisitorMap::None
|
||||
|
@ -5,10 +5,8 @@
|
||||
// makes all other generics or inline functions that it references
|
||||
// reachable as well.
|
||||
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs};
|
||||
use rustc::middle::privacy;
|
||||
use rustc::session::config;
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::{self, TyCtxt};
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
@ -17,10 +15,10 @@ use rustc_hir as hir;
|
||||
use rustc_hir::def::{DefKind, Res};
|
||||
use rustc_hir::def_id::LOCAL_CRATE;
|
||||
use rustc_hir::def_id::{CrateNum, DefId};
|
||||
use rustc_hir::intravisit;
|
||||
use rustc_hir::intravisit::{NestedVisitorMap, Visitor};
|
||||
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
|
||||
use rustc_hir::itemlikevisit::ItemLikeVisitor;
|
||||
use rustc_hir::{HirIdSet, Node};
|
||||
use rustc_session::config;
|
||||
use rustc_target::spec::abi::Abi;
|
||||
|
||||
// Returns true if the given item must be inlined because it may be
|
||||
@ -83,7 +81,7 @@ struct ReachableContext<'a, 'tcx> {
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> Visitor<'tcx> for ReachableContext<'a, 'tcx> {
|
||||
type Map = Map<'tcx>;
|
||||
type Map = intravisit::ErasedMap<'tcx>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
|
||||
NestedVisitorMap::None
|
||||
|
@ -6,7 +6,6 @@
|
||||
//!
|
||||
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/borrow_check.html
|
||||
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::middle::region::*;
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::TyCtxt;
|
||||
@ -696,7 +695,7 @@ impl<'tcx> RegionResolutionVisitor<'tcx> {
|
||||
}
|
||||
|
||||
impl<'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx> {
|
||||
type Map = Map<'tcx>;
|
||||
type Map = intravisit::ErasedMap<'tcx>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
|
||||
NestedVisitorMap::None
|
||||
|
@ -2,11 +2,8 @@
|
||||
//! propagating default levels lexically from parent to children ast nodes.
|
||||
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::lint;
|
||||
use rustc::middle::privacy::AccessLevels;
|
||||
use rustc::middle::stability::{DeprecationEntry, Index};
|
||||
use rustc::session::parse::feature_err;
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_ast::ast::Attribute;
|
||||
@ -18,6 +15,9 @@ use rustc_hir::def::{DefKind, Res};
|
||||
use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
|
||||
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
|
||||
use rustc_hir::{Generics, HirId, Item, StructField, Variant};
|
||||
use rustc_session::lint;
|
||||
use rustc_session::parse::feature_err;
|
||||
use rustc_session::Session;
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use rustc_span::Span;
|
||||
use rustc_trait_selection::traits::misc::can_type_implement_copy;
|
||||
|
@ -1,6 +1,5 @@
|
||||
//! Upvar (closure capture) collection from cross-body HIR uses of `Res::Local`s.
|
||||
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
|
||||
@ -44,7 +43,7 @@ struct LocalCollector {
|
||||
}
|
||||
|
||||
impl Visitor<'tcx> for LocalCollector {
|
||||
type Map = Map<'tcx>;
|
||||
type Map = intravisit::ErasedMap<'tcx>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
|
||||
NestedVisitorMap::None
|
||||
@ -73,7 +72,7 @@ impl CaptureCollector<'_, '_> {
|
||||
}
|
||||
|
||||
impl Visitor<'tcx> for CaptureCollector<'a, 'tcx> {
|
||||
type Map = Map<'tcx>;
|
||||
type Map = intravisit::ErasedMap<'tcx>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
|
||||
NestedVisitorMap::None
|
||||
|
@ -2,15 +2,13 @@
|
||||
|
||||
use rustc::middle::lang_items;
|
||||
use rustc::middle::lang_items::whitelisted;
|
||||
use rustc::session::config;
|
||||
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_errors::struct_span_err;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
|
||||
use rustc_hir::weak_lang_items::WEAK_ITEMS_REFS;
|
||||
use rustc_session::config;
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_span::Span;
|
||||
|
||||
@ -85,9 +83,9 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
|
||||
}
|
||||
|
||||
impl<'a, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx> {
|
||||
type Map = Map<'v>;
|
||||
type Map = intravisit::ErasedMap<'v>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> NestedVisitorMap<Map<'v>> {
|
||||
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
|
||||
NestedVisitorMap::None
|
||||
}
|
||||
|
||||
|
@ -17,4 +17,5 @@ rustc_hir = { path = "../librustc_hir" }
|
||||
rustc_lint = { path = "../librustc_lint" }
|
||||
rustc_metadata = { path = "../librustc_metadata" }
|
||||
rustc_ast = { path = "../librustc_ast" }
|
||||
rustc_session = { path = "../librustc_session" }
|
||||
rustc_span = { path = "../librustc_span" }
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
use crate::Registry;
|
||||
use rustc::middle::cstore::MetadataLoader;
|
||||
use rustc::session::Session;
|
||||
use rustc_ast::ast::{Crate, Ident};
|
||||
use rustc_errors::struct_span_err;
|
||||
use rustc_metadata::locator;
|
||||
use rustc_session::Session;
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::Span;
|
||||
|
||||
|
@ -14,6 +14,7 @@ rustc_attr = { path = "../librustc_attr" }
|
||||
rustc_errors = { path = "../librustc_errors" }
|
||||
rustc_hir = { path = "../librustc_hir" }
|
||||
rustc_typeck = { path = "../librustc_typeck" }
|
||||
rustc_session = { path = "../librustc_session" }
|
||||
rustc_ast = { path = "../librustc_ast" }
|
||||
rustc_span = { path = "../librustc_span" }
|
||||
rustc_data_structures = { path = "../librustc_data_structures" }
|
||||
|
@ -5,7 +5,6 @@
|
||||
|
||||
use rustc::bug;
|
||||
use rustc::hir::map::Map;
|
||||
use rustc::lint;
|
||||
use rustc::middle::privacy::{AccessLevel, AccessLevels};
|
||||
use rustc::ty::fold::TypeVisitor;
|
||||
use rustc::ty::query::Providers;
|
||||
@ -20,6 +19,7 @@ use rustc_hir::def::{DefKind, Res};
|
||||
use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
|
||||
use rustc_hir::intravisit::{self, DeepVisitor, NestedVisitorMap, Visitor};
|
||||
use rustc_hir::{AssocItemKind, HirIdSet, Node, PatKind};
|
||||
use rustc_session::lint;
|
||||
use rustc_span::hygiene::Transparency;
|
||||
use rustc_span::symbol::{kw, sym};
|
||||
use rustc_span::Span;
|
||||
@ -1447,7 +1447,7 @@ impl<'a, 'tcx> ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
|
||||
}
|
||||
|
||||
impl<'a, 'b, 'tcx, 'v> Visitor<'v> for ObsoleteCheckTypeForPrivatenessVisitor<'a, 'b, 'tcx> {
|
||||
type Map = Map<'v>;
|
||||
type Map = intravisit::ErasedMap<'v>;
|
||||
|
||||
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
|
||||
NestedVisitorMap::None
|
||||
|
@ -26,12 +26,13 @@
|
||||
use crate::imports::ImportKind;
|
||||
use crate::Resolver;
|
||||
|
||||
use rustc::{lint, ty};
|
||||
use rustc::ty;
|
||||
use rustc_ast::ast;
|
||||
use rustc_ast::node_id::NodeMap;
|
||||
use rustc_ast::visit::{self, Visitor};
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_errors::pluralize;
|
||||
use rustc_session::lint::builtin::{MACRO_USE_EXTERN_CRATE, UNUSED_IMPORTS};
|
||||
use rustc_session::lint::BuiltinLintDiagnostics;
|
||||
use rustc_span::{MultiSpan, Span, DUMMY_SP};
|
||||
|
||||
@ -232,7 +233,7 @@ impl Resolver<'_> {
|
||||
if let ImportKind::MacroUse = import.kind {
|
||||
if !import.span.is_dummy() {
|
||||
self.lint_buffer.buffer_lint(
|
||||
lint::builtin::MACRO_USE_EXTERN_CRATE,
|
||||
MACRO_USE_EXTERN_CRATE,
|
||||
import.id,
|
||||
import.span,
|
||||
"deprecated `#[macro_use]` attribute used to \
|
||||
@ -247,9 +248,8 @@ impl Resolver<'_> {
|
||||
self.maybe_unused_extern_crates.push((import.id, import.span));
|
||||
}
|
||||
ImportKind::MacroUse => {
|
||||
let lint = lint::builtin::UNUSED_IMPORTS;
|
||||
let msg = "unused `#[macro_use]` import";
|
||||
self.lint_buffer.buffer_lint(lint, import.id, import.span, msg);
|
||||
self.lint_buffer.buffer_lint(UNUSED_IMPORTS, import.id, import.span, msg);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
@ -314,7 +314,7 @@ impl Resolver<'_> {
|
||||
};
|
||||
|
||||
visitor.r.lint_buffer.buffer_lint_with_diagnostic(
|
||||
lint::builtin::UNUSED_IMPORTS,
|
||||
UNUSED_IMPORTS,
|
||||
unused.use_tree_id,
|
||||
ms,
|
||||
&msg,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user