diff options
| -rw-r--r-- | src/librustc/hir/mod.rs | 115 | ||||
| -rw-r--r-- | src/librustc/middle/codegen_fn_attrs.rs | 116 | ||||
| -rw-r--r-- | src/librustc/middle/mod.rs | 1 | ||||
| -rw-r--r-- | src/librustc/ty/instance.rs | 2 | ||||
| -rw-r--r-- | src/librustc/ty/query/mod.rs | 3 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/attributes.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/base.rs | 17 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/consts.rs | 8 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/debuginfo/metadata.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/debuginfo/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/back/symbol_export.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/base.rs | 3 | ||||
| -rw-r--r-- | src/librustc_codegen_utils/symbol_names.rs | 2 | ||||
| -rw-r--r-- | src/librustc_mir/monomorphize/collector.rs | 3 | ||||
| -rw-r--r-- | src/librustc_mir/monomorphize/partitioning.rs | 2 | ||||
| -rw-r--r-- | src/librustc_mir/transform/inline.rs | 2 | ||||
| -rw-r--r-- | src/librustc_passes/dead.rs | 2 | ||||
| -rw-r--r-- | src/librustc_passes/reachable.rs | 13 | ||||
| -rw-r--r-- | src/librustc_typeck/collect.rs | 3 |
19 files changed, 151 insertions, 149 deletions
diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index b7609fa0898..959a4a0a304 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -10,7 +10,6 @@ pub use self::UnsafeSource::*; use crate::hir::def::{DefKind, Res}; use crate::hir::def_id::{DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX}; -use crate::mir::mono::Linkage; use crate::ty::query::Providers; use crate::util::nodemap::{FxHashSet, NodeMap}; @@ -29,7 +28,6 @@ use syntax::ast::{self, AsmDialect, CrateSugar, Ident, Name, NodeId}; use syntax::ast::{AttrVec, Attribute, FloatTy, IntTy, Label, LitKind, StrStyle, UintTy}; pub use syntax::ast::{BorrowKind, ImplPolarity, IsAuto}; pub use syntax::ast::{CaptureBy, Constness, Movability, Mutability, Unsafety}; -use syntax::attr::{InlineAttr, OptimizeAttr}; use syntax::tokenstream::TokenStream; use syntax::util::parser::ExprPrecedence; @@ -2668,119 +2666,6 @@ pub fn provide(providers: &mut Providers<'_>) { upvars::provide(providers); } -#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)] -pub struct CodegenFnAttrs { - pub flags: CodegenFnAttrFlags, - /// Parsed representation of the `#[inline]` attribute - pub inline: InlineAttr, - /// Parsed representation of the `#[optimize]` attribute - pub optimize: OptimizeAttr, - /// The `#[export_name = "..."]` attribute, indicating a custom symbol a - /// function should be exported under - pub export_name: Option<Symbol>, - /// The `#[link_name = "..."]` attribute, indicating a custom symbol an - /// imported function should be imported as. Note that `export_name` - /// probably isn't set when this is set, this is for foreign items while - /// `#[export_name]` is for Rust-defined functions. - pub link_name: Option<Symbol>, - /// The `#[link_ordinal = "..."]` attribute, indicating an ordinal an - /// imported function has in the dynamic library. Note that this must not - /// be set when `link_name` is set. This is for foreign items with the - /// "raw-dylib" kind. - pub link_ordinal: Option<usize>, - /// The `#[target_feature(enable = "...")]` attribute and the enabled - /// features (only enabled features are supported right now). - pub target_features: Vec<Symbol>, - /// The `#[linkage = "..."]` attribute and the value we found. - pub linkage: Option<Linkage>, - /// The `#[link_section = "..."]` attribute, or what executable section this - /// should be placed in. - pub link_section: Option<Symbol>, -} - -bitflags! { - #[derive(RustcEncodable, RustcDecodable, HashStable)] - pub struct CodegenFnAttrFlags: u32 { - /// `#[cold]`: a hint to LLVM that this function, when called, is never on - /// the hot path. - const COLD = 1 << 0; - /// `#[rustc_allocator]`: a hint to LLVM that the pointer returned from this - /// function is never null. - const ALLOCATOR = 1 << 1; - /// `#[unwind]`: an indicator that this function may unwind despite what - /// its ABI signature may otherwise imply. - const UNWIND = 1 << 2; - /// `#[rust_allocator_nounwind]`, an indicator that an imported FFI - /// function will never unwind. Probably obsolete by recent changes with - /// #[unwind], but hasn't been removed/migrated yet - const RUSTC_ALLOCATOR_NOUNWIND = 1 << 3; - /// `#[naked]`: an indicator to LLVM that no function prologue/epilogue - /// should be generated. - const NAKED = 1 << 4; - /// `#[no_mangle]`: an indicator that the function's name should be the same - /// as its symbol. - const NO_MANGLE = 1 << 5; - /// `#[rustc_std_internal_symbol]`: an indicator that this symbol is a - /// "weird symbol" for the standard library in that it has slightly - /// different linkage, visibility, and reachability rules. - const RUSTC_STD_INTERNAL_SYMBOL = 1 << 6; - /// `#[no_debug]`: an indicator that no debugging information should be - /// generated for this function by LLVM. - const NO_DEBUG = 1 << 7; - /// `#[thread_local]`: indicates a static is actually a thread local - /// piece of memory - const THREAD_LOCAL = 1 << 8; - /// `#[used]`: indicates that LLVM can't eliminate this function (but the - /// linker can!). - const USED = 1 << 9; - /// `#[ffi_returns_twice]`, indicates that an extern function can return - /// multiple times - const FFI_RETURNS_TWICE = 1 << 10; - /// `#[track_caller]`: allow access to the caller location - const TRACK_CALLER = 1 << 11; - } -} - -impl CodegenFnAttrs { - pub fn new() -> CodegenFnAttrs { - CodegenFnAttrs { - flags: CodegenFnAttrFlags::empty(), - inline: InlineAttr::None, - optimize: OptimizeAttr::None, - export_name: None, - link_name: None, - link_ordinal: None, - target_features: vec![], - linkage: None, - link_section: None, - } - } - - /// Returns `true` if `#[inline]` or `#[inline(always)]` is present. - pub fn requests_inline(&self) -> bool { - match self.inline { - InlineAttr::Hint | InlineAttr::Always => true, - InlineAttr::None | InlineAttr::Never => false, - } - } - - /// Returns `true` if it looks like this symbol needs to be exported, for example: - /// - /// * `#[no_mangle]` is present - /// * `#[export_name(...)]` is present - /// * `#[linkage]` is present - pub fn contains_extern_indicator(&self) -> bool { - self.flags.contains(CodegenFnAttrFlags::NO_MANGLE) - || self.export_name.is_some() - || match self.linkage { - // These are private, so make sure we don't try to consider - // them external. - None | Some(Linkage::Internal) | Some(Linkage::Private) => false, - Some(_) => true, - } - } -} - #[derive(Copy, Clone, Debug)] pub enum Node<'hir> { Param(&'hir Param<'hir>), diff --git a/src/librustc/middle/codegen_fn_attrs.rs b/src/librustc/middle/codegen_fn_attrs.rs new file mode 100644 index 00000000000..3b109f2fea6 --- /dev/null +++ b/src/librustc/middle/codegen_fn_attrs.rs @@ -0,0 +1,116 @@ +use crate::mir::mono::Linkage; +use rustc_span::symbol::Symbol; +use syntax::attr::{InlineAttr, OptimizeAttr}; + +#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)] +pub struct CodegenFnAttrs { + pub flags: CodegenFnAttrFlags, + /// Parsed representation of the `#[inline]` attribute + pub inline: InlineAttr, + /// Parsed representation of the `#[optimize]` attribute + pub optimize: OptimizeAttr, + /// The `#[export_name = "..."]` attribute, indicating a custom symbol a + /// function should be exported under + pub export_name: Option<Symbol>, + /// The `#[link_name = "..."]` attribute, indicating a custom symbol an + /// imported function should be imported as. Note that `export_name` + /// probably isn't set when this is set, this is for foreign items while + /// `#[export_name]` is for Rust-defined functions. + pub link_name: Option<Symbol>, + /// The `#[link_ordinal = "..."]` attribute, indicating an ordinal an + /// imported function has in the dynamic library. Note that this must not + /// be set when `link_name` is set. This is for foreign items with the + /// "raw-dylib" kind. + pub link_ordinal: Option<usize>, + /// The `#[target_feature(enable = "...")]` attribute and the enabled + /// features (only enabled features are supported right now). + pub target_features: Vec<Symbol>, + /// The `#[linkage = "..."]` attribute and the value we found. + pub linkage: Option<Linkage>, + /// The `#[link_section = "..."]` attribute, or what executable section this + /// should be placed in. + pub link_section: Option<Symbol>, +} + +bitflags! { + #[derive(RustcEncodable, RustcDecodable, HashStable)] + pub struct CodegenFnAttrFlags: u32 { + /// `#[cold]`: a hint to LLVM that this function, when called, is never on + /// the hot path. + const COLD = 1 << 0; + /// `#[rustc_allocator]`: a hint to LLVM that the pointer returned from this + /// function is never null. + const ALLOCATOR = 1 << 1; + /// `#[unwind]`: an indicator that this function may unwind despite what + /// its ABI signature may otherwise imply. + const UNWIND = 1 << 2; + /// `#[rust_allocator_nounwind]`, an indicator that an imported FFI + /// function will never unwind. Probably obsolete by recent changes with + /// #[unwind], but hasn't been removed/migrated yet + const RUSTC_ALLOCATOR_NOUNWIND = 1 << 3; + /// `#[naked]`: an indicator to LLVM that no function prologue/epilogue + /// should be generated. + const NAKED = 1 << 4; + /// `#[no_mangle]`: an indicator that the function's name should be the same + /// as its symbol. + const NO_MANGLE = 1 << 5; + /// `#[rustc_std_internal_symbol]`: an indicator that this symbol is a + /// "weird symbol" for the standard library in that it has slightly + /// different linkage, visibility, and reachability rules. + const RUSTC_STD_INTERNAL_SYMBOL = 1 << 6; + /// `#[no_debug]`: an indicator that no debugging information should be + /// generated for this function by LLVM. + const NO_DEBUG = 1 << 7; + /// `#[thread_local]`: indicates a static is actually a thread local + /// piece of memory + const THREAD_LOCAL = 1 << 8; + /// `#[used]`: indicates that LLVM can't eliminate this function (but the + /// linker can!). + const USED = 1 << 9; + /// `#[ffi_returns_twice]`, indicates that an extern function can return + /// multiple times + const FFI_RETURNS_TWICE = 1 << 10; + /// `#[track_caller]`: allow access to the caller location + const TRACK_CALLER = 1 << 11; + } +} + +impl CodegenFnAttrs { + pub fn new() -> CodegenFnAttrs { + CodegenFnAttrs { + flags: CodegenFnAttrFlags::empty(), + inline: InlineAttr::None, + optimize: OptimizeAttr::None, + export_name: None, + link_name: None, + link_ordinal: None, + target_features: vec![], + linkage: None, + link_section: None, + } + } + + /// Returns `true` if `#[inline]` or `#[inline(always)]` is present. + pub fn requests_inline(&self) -> bool { + match self.inline { + InlineAttr::Hint | InlineAttr::Always => true, + InlineAttr::None | InlineAttr::Never => false, + } + } + + /// Returns `true` if it looks like this symbol needs to be exported, for example: + /// + /// * `#[no_mangle]` is present + /// * `#[export_name(...)]` is present + /// * `#[linkage]` is present + pub fn contains_extern_indicator(&self) -> bool { + self.flags.contains(CodegenFnAttrFlags::NO_MANGLE) + || self.export_name.is_some() + || match self.linkage { + // These are private, so make sure we don't try to consider + // them external. + None | Some(Linkage::Internal) | Some(Linkage::Private) => false, + Some(_) => true, + } + } +} diff --git a/src/librustc/middle/mod.rs b/src/librustc/middle/mod.rs index 96b14eae8ea..c2959766c57 100644 --- a/src/librustc/middle/mod.rs +++ b/src/librustc/middle/mod.rs @@ -1,3 +1,4 @@ +pub mod codegen_fn_attrs; pub mod cstore; pub mod dependency_format; pub mod exported_symbols; diff --git a/src/librustc/ty/instance.rs b/src/librustc/ty/instance.rs index cfd1779c080..a7e716ad7b7 100644 --- a/src/librustc/ty/instance.rs +++ b/src/librustc/ty/instance.rs @@ -1,6 +1,6 @@ use crate::hir::def::Namespace; use crate::hir::def_id::DefId; -use crate::hir::CodegenFnAttrFlags; +use crate::middle::codegen_fn_attrs::CodegenFnAttrFlags; use crate::middle::lang_items::DropInPlaceFnLangItem; use crate::traits; use crate::ty::print::{FmtPrinter, Printer}; diff --git a/src/librustc/ty/query/mod.rs b/src/librustc/ty/query/mod.rs index 1907e6c82c6..5f739c4e6e6 100644 --- a/src/librustc/ty/query/mod.rs +++ b/src/librustc/ty/query/mod.rs @@ -1,9 +1,10 @@ use crate::dep_graph::{self, DepNode}; use crate::hir::def::{DefKind, Export}; use crate::hir::def_id::{CrateNum, DefId, DefIndex}; -use crate::hir::{self, CodegenFnAttrs, ItemLocalId, TraitCandidate}; +use crate::hir::{self, ItemLocalId, TraitCandidate}; use crate::infer::canonical::{self, Canonical}; use crate::lint; +use crate::middle::codegen_fn_attrs::CodegenFnAttrs; use crate::middle::cstore::{CrateSource, DepKind, NativeLibraryKind}; use crate::middle::cstore::{ExternCrate, ForeignModule, LinkagePreference, NativeLibrary}; use crate::middle::exported_symbols::{ExportedSymbol, SymbolExportLevel}; diff --git a/src/librustc_codegen_llvm/attributes.rs b/src/librustc_codegen_llvm/attributes.rs index 942ba9f868c..a7826282314 100644 --- a/src/librustc_codegen_llvm/attributes.rs +++ b/src/librustc_codegen_llvm/attributes.rs @@ -3,7 +3,7 @@ use std::ffi::CString; use rustc::hir::def_id::{DefId, LOCAL_CRATE}; -use rustc::hir::CodegenFnAttrFlags; +use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc::session::config::{OptLevel, Sanitizer}; use rustc::session::Session; use rustc::ty::layout::HasTyCtxt; diff --git a/src/librustc_codegen_llvm/base.rs b/src/librustc_codegen_llvm/base.rs index c757fb596b1..cb44a56d075 100644 --- a/src/librustc_codegen_llvm/base.rs +++ b/src/librustc_codegen_llvm/base.rs @@ -14,33 +14,32 @@ //! int)` and `rec(x=int, y=int, z=int)` will have the same `llvm::Type`. use super::{LlvmCodegenBackend, ModuleLlvm}; -use rustc_codegen_ssa::base::maybe_create_entry_wrapper; -use rustc_codegen_ssa::{ModuleCodegen, ModuleKind}; use crate::builder::Builder; use crate::common; use crate::context::CodegenCx; use crate::llvm; use crate::metadata; +use crate::value::Value; + use rustc::dep_graph; +use rustc::middle::codegen_fn_attrs::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::mono_item::MonoItemExt; -use rustc_data_structures::small_c_str::SmallCStr; - use rustc_codegen_ssa::back::write::submit_codegened_module_to_llvm; +use rustc_codegen_ssa::base::maybe_create_entry_wrapper; +use rustc_codegen_ssa::mono_item::MonoItemExt; use rustc_codegen_ssa::traits::*; - -use rustc::hir::CodegenFnAttrs; +use rustc_codegen_ssa::{ModuleCodegen, ModuleKind}; +use rustc_data_structures::small_c_str::SmallCStr; use rustc_span::symbol::Symbol; + use std::ffi::CString; use std::time::Instant; -use crate::value::Value; - pub fn write_compressed_metadata<'tcx>( tcx: TyCtxt<'tcx>, metadata: &EncodedMetadata, diff --git a/src/librustc_codegen_llvm/consts.rs b/src/librustc_codegen_llvm/consts.rs index 318037b5bd8..4b4fbd0e1ad 100644 --- a/src/librustc_codegen_llvm/consts.rs +++ b/src/librustc_codegen_llvm/consts.rs @@ -8,9 +8,11 @@ use crate::value::Value; use libc::c_uint; use log::debug; use rustc::hir::def_id::DefId; -use rustc::hir::Node; +use rustc::hir::{self, Node}; +use rustc::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}; use rustc::mir::interpret::{read_target_uint, Allocation, ConstValue, ErrorHandled, Pointer}; use rustc::mir::mono::MonoItem; +use rustc::ty::layout::{self, Align, LayoutOf, Size}; use rustc::ty::{self, Instance, Ty}; use rustc::{bug, span_bug}; use rustc_codegen_ssa::traits::*; @@ -18,10 +20,6 @@ use rustc_span::symbol::{sym, Symbol}; use rustc_span::Span; use rustc_target::abi::HasDataLayout; -use rustc::ty::layout::{self, Align, LayoutOf, Size}; - -use rustc::hir::{self, CodegenFnAttrFlags, CodegenFnAttrs}; - use std::ffi::CStr; pub fn const_alloc_to_llvm(cx: &CodegenCx<'ll, '_>, alloc: &Allocation) -> &'ll Value { diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs index 61ccd782010..a03938082da 100644 --- a/src/librustc_codegen_llvm/debuginfo/metadata.rs +++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs @@ -22,8 +22,8 @@ use crate::value::Value; use log::debug; use rustc::hir::def::CtorKind; use rustc::hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; -use rustc::hir::CodegenFnAttrFlags; 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}; diff --git a/src/librustc_codegen_llvm/debuginfo/mod.rs b/src/librustc_codegen_llvm/debuginfo/mod.rs index 16ae3c95030..143fa651a15 100644 --- a/src/librustc_codegen_llvm/debuginfo/mod.rs +++ b/src/librustc_codegen_llvm/debuginfo/mod.rs @@ -14,7 +14,7 @@ use crate::llvm::debuginfo::{ DIArray, DIBuilder, DIFile, DIFlags, DILexicalBlock, DISPFlags, DIScope, DIType, }; use rustc::hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; -use rustc::hir::CodegenFnAttrFlags; +use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc::ty::subst::{GenericArgKind, SubstsRef}; use crate::abi::FnAbi; diff --git a/src/librustc_codegen_ssa/back/symbol_export.rs b/src/librustc_codegen_ssa/back/symbol_export.rs index 5bdb310f9b5..fba221a80f7 100644 --- a/src/librustc_codegen_ssa/back/symbol_export.rs +++ b/src/librustc_codegen_ssa/back/symbol_export.rs @@ -3,8 +3,8 @@ use std::sync::Arc; use rustc::hir; use rustc::hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE}; -use rustc::hir::CodegenFnAttrFlags; use rustc::hir::Node; +use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc::middle::exported_symbols::{metadata_symbol_name, ExportedSymbol, SymbolExportLevel}; use rustc::session::config; use rustc::ty::query::Providers; diff --git a/src/librustc_codegen_ssa/base.rs b/src/librustc_codegen_ssa/base.rs index 27841d67c1a..d340e0f2523 100644 --- a/src/librustc_codegen_ssa/base.rs +++ b/src/librustc_codegen_ssa/base.rs @@ -27,6 +27,7 @@ use crate::{CachedModuleCodegen, CrateInfo, MemFlags, ModuleCodegen, ModuleKind} use rustc::hir; use rustc::hir::def_id::{DefId, LOCAL_CRATE}; +use rustc::middle::codegen_fn_attrs::CodegenFnAttrs; use rustc::middle::cstore::EncodedMetadata; use rustc::middle::cstore::{self, LinkagePreference}; use rustc::middle::lang_items::StartFnLangItem; @@ -811,7 +812,7 @@ pub fn provide_both(providers: &mut Providers<'_>) { let (defids, _) = tcx.collect_and_partition_mono_items(cratenum); for id in &*defids { - let hir::CodegenFnAttrs { optimize, .. } = tcx.codegen_fn_attrs(*id); + let CodegenFnAttrs { optimize, .. } = tcx.codegen_fn_attrs(*id); match optimize { attr::OptimizeAttr::None => continue, attr::OptimizeAttr::Size => continue, diff --git a/src/librustc_codegen_utils/symbol_names.rs b/src/librustc_codegen_utils/symbol_names.rs index 533ce620b67..e479573038b 100644 --- a/src/librustc_codegen_utils/symbol_names.rs +++ b/src/librustc_codegen_utils/symbol_names.rs @@ -88,8 +88,8 @@ //! DefPaths which are much more robust in the face of changes to the code base. use rustc::hir::def_id::LOCAL_CRATE; -use rustc::hir::CodegenFnAttrFlags; use rustc::hir::Node; +use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc::mir::mono::{InstantiationMode, MonoItem}; use rustc::session::config::SymbolManglingVersion; use rustc::ty::query::Providers; diff --git a/src/librustc_mir/monomorphize/collector.rs b/src/librustc_mir/monomorphize/collector.rs index 6c8f8f6c227..16319d1ab37 100644 --- a/src/librustc_mir/monomorphize/collector.rs +++ b/src/librustc_mir/monomorphize/collector.rs @@ -176,9 +176,10 @@ use crate::monomorphize; +use rustc::hir; use rustc::hir::def_id::{DefId, LOCAL_CRATE}; use rustc::hir::itemlikevisit::ItemLikeVisitor; -use rustc::hir::{self, CodegenFnAttrFlags}; +use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc::middle::lang_items::{ExchangeMallocFnLangItem, StartFnLangItem}; use rustc::mir::interpret::{AllocId, ConstValue}; use rustc::mir::interpret::{ErrorHandled, GlobalAlloc, Scalar}; diff --git a/src/librustc_mir/monomorphize/partitioning.rs b/src/librustc_mir/monomorphize/partitioning.rs index 8011de19e78..afbae7676fd 100644 --- a/src/librustc_mir/monomorphize/partitioning.rs +++ b/src/librustc_mir/monomorphize/partitioning.rs @@ -98,7 +98,7 @@ use std::sync::Arc; use rustc::hir::def::DefKind; use rustc::hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE}; -use rustc::hir::CodegenFnAttrFlags; +use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc::middle::exported_symbols::SymbolExportLevel; use rustc::mir::mono::{CodegenUnit, CodegenUnitNameBuilder, Linkage, Visibility}; use rustc::mir::mono::{InstantiationMode, MonoItem}; diff --git a/src/librustc_mir/transform/inline.rs b/src/librustc_mir/transform/inline.rs index 3c9f8542e51..52a105658bd 100644 --- a/src/librustc_mir/transform/inline.rs +++ b/src/librustc_mir/transform/inline.rs @@ -1,11 +1,11 @@ //! Inlining pass for MIR functions use rustc::hir::def_id::DefId; -use rustc::hir::CodegenFnAttrFlags; 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::ty::subst::{InternalSubsts, Subst, SubstsRef}; diff --git a/src/librustc_passes/dead.rs b/src/librustc_passes/dead.rs index 22f3533b1e4..8e813ec692e 100644 --- a/src/librustc_passes/dead.rs +++ b/src/librustc_passes/dead.rs @@ -9,8 +9,8 @@ use rustc::hir::{self, PatKind, TyKind}; use rustc::hir::def::{CtorOf, DefKind, Res}; use rustc::hir::def_id::{DefId, LOCAL_CRATE}; -use rustc::hir::CodegenFnAttrFlags; use rustc::lint; +use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc::middle::privacy; use rustc::ty::{self, DefIdTree, TyCtxt}; use rustc::util::nodemap::FxHashSet; diff --git a/src/librustc_passes/reachable.rs b/src/librustc_passes/reachable.rs index 5241d9ea43f..c3ab595ad68 100644 --- a/src/librustc_passes/reachable.rs +++ b/src/librustc_passes/reachable.rs @@ -5,22 +5,21 @@ // makes all other generics or inline functions that it references // reachable as well. +use rustc::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::itemlikevisit::ItemLikeVisitor; use rustc::hir::Node; -use rustc::hir::{CodegenFnAttrFlags, CodegenFnAttrs}; +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::util::nodemap::{FxHashSet, HirIdSet}; use rustc_data_structures::sync::Lrc; - -use rustc::hir; -use rustc::hir::def_id::LOCAL_CRATE; -use rustc::hir::intravisit; -use rustc::hir::intravisit::{NestedVisitorMap, Visitor}; -use rustc::hir::itemlikevisit::ItemLikeVisitor; use rustc_target::spec::abi::Abi; // Returns true if the given item must be inlined because it may be diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index d13ddb28bf9..1d20ef2fe07 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -20,6 +20,7 @@ use crate::constrained_generic_params as cgp; use crate::lint; use crate::middle::resolve_lifetime as rl; use crate::middle::weak_lang_items; +use rustc::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}; use rustc::mir::mono::Linkage; use rustc::ty::query::Providers; use rustc::ty::subst::GenericArgKind; @@ -44,7 +45,7 @@ use rustc::hir::def_id::{DefId, LOCAL_CRATE}; use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor}; use rustc::hir::GenericParamKind; use rustc::hir::Node; -use rustc::hir::{self, CodegenFnAttrFlags, CodegenFnAttrs, Unsafety}; +use rustc::hir::{self, Unsafety}; use errors::{Applicability, StashKey}; |
