mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-18 18:04:13 +00:00
Enable feature gate extern_crate_item_prelude
This commit is contained in:
parent
d20f54bb1a
commit
648f491977
@ -1,7 +1,7 @@
|
||||
use std::iter;
|
||||
|
||||
use crate::rustc::hir;
|
||||
use crate::rustc_target::spec::abi::Abi;
|
||||
use rustc::hir;
|
||||
use rustc_target::spec::abi::Abi;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
use crate::prelude::*;
|
||||
|
||||
use crate::rustc::middle::allocator::AllocatorKind;
|
||||
use crate::rustc_allocator::{ALLOCATOR_METHODS, AllocatorTy};
|
||||
use rustc::middle::allocator::AllocatorKind;
|
||||
use rustc_allocator::{ALLOCATOR_METHODS, AllocatorTy};
|
||||
|
||||
pub fn codegen(tcx: TyCtxt, module: &mut Module<impl Backend + 'static>, kind: AllocatorKind) {
|
||||
let usize_ty = module.target_config().pointer_type();
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::prelude::*;
|
||||
|
||||
use crate::rustc::mir::StatementKind::*;
|
||||
use rustc::mir::StatementKind::*;
|
||||
|
||||
bitflags! {
|
||||
pub struct Flags: u8 {
|
||||
|
@ -606,7 +606,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
|
||||
lval.write_cvalue(fx, CValue::ByVal(len, usize_layout));
|
||||
}
|
||||
Rvalue::NullaryOp(NullOp::Box, content_ty) => {
|
||||
use crate::rustc::middle::lang_items::ExchangeMallocFnLangItem;
|
||||
use rustc::middle::lang_items::ExchangeMallocFnLangItem;
|
||||
|
||||
let usize_type = fx.cton_type(fx.tcx.types.usize).unwrap();
|
||||
let (size, align) = fx.layout_of(content_ty).size_and_align();
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::fmt;
|
||||
|
||||
use crate::rustc_target::spec::{HasTargetSpec, Target};
|
||||
use rustc_target::spec::{HasTargetSpec, Target};
|
||||
|
||||
use cranelift_module::Module;
|
||||
|
||||
|
@ -1,11 +1,14 @@
|
||||
use cranelift_module::*;
|
||||
use crate::prelude::*;
|
||||
use crate::rustc::mir::interpret::{
|
||||
use std::borrow::Cow;
|
||||
|
||||
use rustc::mir::interpret::{
|
||||
read_target_uint, AllocId, AllocType, Allocation, ConstValue, EvalResult, GlobalId, Scalar,
|
||||
};
|
||||
use crate::rustc::ty::Const;
|
||||
use crate::rustc_mir::interpret::{EvalContext, Machine, Memory, MemoryKind, MemPlace, OpTy, PlaceTy, Pointer};
|
||||
use std::borrow::Cow;
|
||||
use rustc::ty::Const;
|
||||
use rustc_mir::interpret::{EvalContext, Machine, Memory, MemoryKind, MemPlace, OpTy, PlaceTy, Pointer};
|
||||
|
||||
use cranelift_module::*;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct ConstantCx {
|
||||
|
40
src/lib.rs
40
src/lib.rs
@ -1,4 +1,4 @@
|
||||
#![feature(rustc_private, macro_at_most_once_rep, never_type)]
|
||||
#![feature(rustc_private, macro_at_most_once_rep, never_type, extern_crate_item_prelude)]
|
||||
#![allow(intra_doc_link_resolution_failure)]
|
||||
|
||||
extern crate byteorder;
|
||||
@ -26,15 +26,15 @@ extern crate target_lexicon;
|
||||
|
||||
use std::any::Any;
|
||||
use std::fs::File;
|
||||
use std::sync::{mpsc, Arc};
|
||||
use std::sync::mpsc;
|
||||
|
||||
use crate::rustc::dep_graph::DepGraph;
|
||||
use crate::rustc::middle::cstore::MetadataLoader;
|
||||
use crate::rustc::session::{config::OutputFilenames, CompileIncomplete};
|
||||
use crate::rustc::ty::query::Providers;
|
||||
use crate::rustc_codegen_utils::codegen_backend::CodegenBackend;
|
||||
use crate::rustc_codegen_utils::link::out_filename;
|
||||
use crate::syntax::symbol::Symbol;
|
||||
use rustc::dep_graph::DepGraph;
|
||||
use rustc::middle::cstore::MetadataLoader;
|
||||
use rustc::session::{config::OutputFilenames, CompileIncomplete};
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc_codegen_utils::codegen_backend::CodegenBackend;
|
||||
use rustc_codegen_utils::link::out_filename;
|
||||
use syntax::symbol::Symbol;
|
||||
|
||||
use cranelift::codegen::settings;
|
||||
use cranelift_faerie::*;
|
||||
@ -63,24 +63,22 @@ mod prelude {
|
||||
pub use std::any::Any;
|
||||
pub use std::collections::{HashMap, HashSet};
|
||||
|
||||
pub use crate::rustc::hir::def_id::{DefId, LOCAL_CRATE};
|
||||
pub use crate::rustc::mir;
|
||||
pub use crate::rustc::mir::interpret::AllocId;
|
||||
pub use crate::rustc::mir::*;
|
||||
pub use crate::rustc::session::{config::CrateType, Session};
|
||||
pub use crate::rustc::ty::layout::{self, Abi, LayoutOf, Scalar, Size, TyLayout};
|
||||
pub use crate::rustc::ty::{
|
||||
pub use rustc::hir::def_id::{DefId, LOCAL_CRATE};
|
||||
pub use rustc::mir::{self, interpret::AllocId, *};
|
||||
pub use rustc::session::{config::CrateType, Session};
|
||||
pub use rustc::ty::layout::{self, Abi, LayoutOf, Scalar, Size, TyLayout};
|
||||
pub use rustc::ty::{
|
||||
self, subst::Substs, FnSig, Instance, InstanceDef, ParamEnv, PolyFnSig, Ty, TyCtxt,
|
||||
TypeAndMut, TypeFoldable,
|
||||
};
|
||||
pub use crate::rustc_data_structures::{
|
||||
pub use rustc_data_structures::{
|
||||
fx::{FxHashMap, FxHashSet},
|
||||
indexed_vec::Idx,
|
||||
sync::Lrc,
|
||||
};
|
||||
pub use crate::rustc_mir::monomorphize::{collector, MonoItem};
|
||||
pub use crate::syntax::ast::{FloatTy, IntTy, UintTy};
|
||||
pub use crate::syntax::source_map::DUMMY_SP;
|
||||
pub use rustc_mir::monomorphize::{collector, MonoItem};
|
||||
pub use syntax::ast::{FloatTy, IntTy, UintTy};
|
||||
pub use syntax::source_map::DUMMY_SP;
|
||||
|
||||
pub use cranelift::codegen::isa::CallConv;
|
||||
pub use cranelift::codegen::ir::{
|
||||
@ -379,7 +377,7 @@ fn codegen_mono_items<'a, 'tcx: 'a>(
|
||||
let any_dynamic_crate = tcx.sess.dependency_formats.borrow()
|
||||
.iter()
|
||||
.any(|(_, list)| {
|
||||
use crate::rustc::middle::dependency_format::Linkage;
|
||||
use rustc::middle::dependency_format::Linkage;
|
||||
list.iter().any(|&linkage| linkage == Linkage::Dynamic)
|
||||
});
|
||||
if any_dynamic_crate {
|
||||
|
@ -6,8 +6,8 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx: 'a>(
|
||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
module: &mut Module<impl Backend + 'static>,
|
||||
) {
|
||||
use crate::rustc::middle::lang_items::StartFnLangItem;
|
||||
use crate::rustc::session::config::EntryFnType;
|
||||
use rustc::middle::lang_items::StartFnLangItem;
|
||||
use rustc::session::config::EntryFnType;
|
||||
|
||||
let (main_def_id, use_start_lang_item) = match *tcx.sess.entry_fn.borrow() {
|
||||
Some((id, _, entry_ty)) => (
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::rustc::middle::cstore::MetadataLoader;
|
||||
use crate::rustc_data_structures::owning_ref::{self, OwningRef};
|
||||
use rustc::middle::cstore::MetadataLoader;
|
||||
use rustc_data_structures::owning_ref::{self, OwningRef};
|
||||
use std::fs::File;
|
||||
use std::path::Path;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user