mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Rustup to rustc 1.30.0-nightly (cb6d2dfa8
2018-09-16)
This commit is contained in:
parent
39fbea8c1b
commit
a1b8e02a88
@ -1,7 +1,7 @@
|
|||||||
use std::iter;
|
use std::iter;
|
||||||
|
|
||||||
use rustc::hir;
|
use crate::rustc::hir;
|
||||||
use rustc_target::spec::abi::Abi;
|
use crate::rustc_target::spec::abi::Abi;
|
||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
|
||||||
use rustc::mir::StatementKind::*;
|
use crate::rustc::mir::StatementKind::*;
|
||||||
|
|
||||||
bitflags! {
|
bitflags! {
|
||||||
pub struct Flags: u8 {
|
pub struct Flags: u8 {
|
||||||
|
@ -27,7 +27,7 @@ pub fn trans_mono_item<'a, 'tcx: 'a>(
|
|||||||
if inst.def_id().krate == LOCAL_CRATE =>
|
if inst.def_id().krate == LOCAL_CRATE =>
|
||||||
{
|
{
|
||||||
let mut mir = ::std::io::Cursor::new(Vec::new());
|
let mut mir = ::std::io::Cursor::new(Vec::new());
|
||||||
::rustc_mir::util::write_mir_pretty(tcx, Some(inst.def_id()), &mut mir)
|
crate::rustc_mir::util::write_mir_pretty(tcx, Some(inst.def_id()), &mut mir)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
String::from_utf8(mir.into_inner()).unwrap()
|
String::from_utf8(mir.into_inner()).unwrap()
|
||||||
}
|
}
|
||||||
@ -242,7 +242,7 @@ fn codegen_fn_content<'a, 'tcx: 'a>(fx: &mut FunctionCx<'a, 'tcx, impl Backend>)
|
|||||||
} => {
|
} => {
|
||||||
let ty = location.ty(fx.mir, fx.tcx).to_ty(fx.tcx);
|
let ty = location.ty(fx.mir, fx.tcx).to_ty(fx.tcx);
|
||||||
let ty = fx.monomorphize(&ty);
|
let ty = fx.monomorphize(&ty);
|
||||||
let drop_fn = ::rustc_mir::monomorphize::resolve_drop_in_place(fx.tcx, ty);
|
let drop_fn = crate::rustc_mir::monomorphize::resolve_drop_in_place(fx.tcx, ty);
|
||||||
|
|
||||||
if let ty::InstanceDef::DropGlue(_, None) = drop_fn.def {
|
if let ty::InstanceDef::DropGlue(_, None) = drop_fn.def {
|
||||||
// we don't actually need to drop anything
|
// we don't actually need to drop anything
|
||||||
@ -254,7 +254,7 @@ fn codegen_fn_content<'a, 'tcx: 'a>(fx: &mut FunctionCx<'a, 'tcx, impl Backend>)
|
|||||||
&ty::RegionKind::ReErased,
|
&ty::RegionKind::ReErased,
|
||||||
TypeAndMut {
|
TypeAndMut {
|
||||||
ty,
|
ty,
|
||||||
mutbl: ::rustc::hir::Mutability::MutMutable,
|
mutbl: crate::rustc::hir::Mutability::MutMutable,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -580,7 +580,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
|
|||||||
lval.write_cvalue(fx, CValue::ByVal(size, usize_layout));
|
lval.write_cvalue(fx, CValue::ByVal(size, usize_layout));
|
||||||
}
|
}
|
||||||
Rvalue::NullaryOp(NullOp::Box, content_ty) => {
|
Rvalue::NullaryOp(NullOp::Box, content_ty) => {
|
||||||
use rustc::middle::lang_items::ExchangeMallocFnLangItem;
|
use crate::rustc::middle::lang_items::ExchangeMallocFnLangItem;
|
||||||
|
|
||||||
let usize_type = fx.cton_type(fx.tcx.types.usize).unwrap();
|
let usize_type = fx.cton_type(fx.tcx.types.usize).unwrap();
|
||||||
let (size, align) = fx.layout_of(content_ty).size_and_align();
|
let (size, align) = fx.layout_of(content_ty).size_and_align();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
use rustc_target::spec::{HasTargetSpec, Target};
|
use crate::rustc_target::spec::{HasTargetSpec, Target};
|
||||||
|
|
||||||
use cranelift_module::Module;
|
use cranelift_module::Module;
|
||||||
|
|
||||||
@ -372,7 +372,7 @@ impl<'a, 'tcx: 'a> CPlace<'tcx> {
|
|||||||
pub fn write_cvalue(self, fx: &mut FunctionCx<'a, 'tcx, impl Backend>, from: CValue<'tcx>) {
|
pub fn write_cvalue(self, fx: &mut FunctionCx<'a, 'tcx, impl Backend>, from: CValue<'tcx>) {
|
||||||
match (&self.layout().ty.sty, &from.layout().ty.sty) {
|
match (&self.layout().ty.sty, &from.layout().ty.sty) {
|
||||||
(ty::Ref(_, t, dest_mut), ty::Ref(_, u, src_mut))
|
(ty::Ref(_, t, dest_mut), ty::Ref(_, u, src_mut))
|
||||||
if (if *dest_mut != ::rustc::hir::Mutability::MutImmutable && src_mut != dest_mut {
|
if (if *dest_mut != crate::rustc::hir::Mutability::MutImmutable && src_mut != dest_mut {
|
||||||
false
|
false
|
||||||
} else if t != u {
|
} else if t != u {
|
||||||
false
|
false
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
use cranelift_module::*;
|
use cranelift_module::*;
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
use rustc::mir::interpret::{
|
use crate::rustc::mir::interpret::{
|
||||||
read_target_uint, AllocId, AllocType, Allocation, ConstValue, EvalResult, GlobalId,
|
read_target_uint, AllocId, AllocType, Allocation, ConstValue, EvalResult, GlobalId,
|
||||||
};
|
};
|
||||||
use rustc::ty::Const;
|
use crate::rustc::ty::Const;
|
||||||
use rustc_mir::interpret::{CompileTimeEvaluator, EvalContext, Memory, MemoryKind};
|
use crate::rustc_mir::interpret::{CompileTimeEvaluator, EvalContext, Memory, MemoryKind};
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct ConstantCx {
|
pub struct ConstantCx {
|
||||||
@ -154,7 +154,7 @@ fn data_id_for_static<'a, 'tcx: 'a, B: Backend>(
|
|||||||
def_id: DefId,
|
def_id: DefId,
|
||||||
) -> DataId {
|
) -> DataId {
|
||||||
let symbol_name = tcx.symbol_name(Instance::mono(tcx, def_id)).as_str();
|
let symbol_name = tcx.symbol_name(Instance::mono(tcx, def_id)).as_str();
|
||||||
let is_mutable = if let ::rustc::hir::Mutability::MutMutable = tcx.is_static(def_id).unwrap() {
|
let is_mutable = if let crate::rustc::hir::Mutability::MutMutable = tcx.is_static(def_id).unwrap() {
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
!tcx.type_of(def_id)
|
!tcx.type_of(def_id)
|
||||||
|
42
src/lib.rs
42
src/lib.rs
@ -27,14 +27,14 @@ use std::any::Any;
|
|||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::sync::{mpsc, Arc};
|
use std::sync::{mpsc, Arc};
|
||||||
|
|
||||||
use rustc::dep_graph::DepGraph;
|
use crate::rustc::dep_graph::DepGraph;
|
||||||
use rustc::middle::cstore::MetadataLoader;
|
use crate::rustc::middle::cstore::MetadataLoader;
|
||||||
use rustc::session::{config::OutputFilenames, CompileIncomplete};
|
use crate::rustc::session::{config::OutputFilenames, CompileIncomplete};
|
||||||
use rustc::ty::query::Providers;
|
use crate::rustc::ty::query::Providers;
|
||||||
use rustc_codegen_utils::codegen_backend::CodegenBackend;
|
use crate::rustc_codegen_utils::codegen_backend::CodegenBackend;
|
||||||
use rustc_codegen_utils::link::out_filename;
|
use crate::rustc_codegen_utils::link::out_filename;
|
||||||
use rustc_data_structures::svh::Svh;
|
use crate::rustc_data_structures::svh::Svh;
|
||||||
use syntax::symbol::Symbol;
|
use crate::syntax::symbol::Symbol;
|
||||||
|
|
||||||
use cranelift::codegen::settings;
|
use cranelift::codegen::settings;
|
||||||
use cranelift_faerie::*;
|
use cranelift_faerie::*;
|
||||||
@ -60,24 +60,24 @@ mod prelude {
|
|||||||
pub use std::any::Any;
|
pub use std::any::Any;
|
||||||
pub use std::collections::{HashMap, HashSet};
|
pub use std::collections::{HashMap, HashSet};
|
||||||
|
|
||||||
pub use rustc::hir::def_id::{DefId, LOCAL_CRATE};
|
pub use crate::rustc::hir::def_id::{DefId, LOCAL_CRATE};
|
||||||
pub use rustc::mir;
|
pub use crate::rustc::mir;
|
||||||
pub use rustc::mir::interpret::AllocId;
|
pub use crate::rustc::mir::interpret::AllocId;
|
||||||
pub use rustc::mir::*;
|
pub use crate::rustc::mir::*;
|
||||||
pub use rustc::session::{config::CrateType, Session};
|
pub use crate::rustc::session::{config::CrateType, Session};
|
||||||
pub use rustc::ty::layout::{self, Abi, LayoutOf, Scalar, Size, TyLayout};
|
pub use crate::rustc::ty::layout::{self, Abi, LayoutOf, Scalar, Size, TyLayout};
|
||||||
pub use rustc::ty::{
|
pub use crate::rustc::ty::{
|
||||||
self, subst::Substs, FnSig, Instance, InstanceDef, ParamEnv, PolyFnSig, Ty, TyCtxt,
|
self, subst::Substs, FnSig, Instance, InstanceDef, ParamEnv, PolyFnSig, Ty, TyCtxt,
|
||||||
TypeAndMut, TypeFoldable,
|
TypeAndMut, TypeFoldable,
|
||||||
};
|
};
|
||||||
pub use rustc_data_structures::{
|
pub use crate::rustc_data_structures::{
|
||||||
fx::{FxHashMap, FxHashSet},
|
fx::{FxHashMap, FxHashSet},
|
||||||
indexed_vec::Idx,
|
indexed_vec::Idx,
|
||||||
sync::Lrc,
|
sync::Lrc,
|
||||||
};
|
};
|
||||||
pub use rustc_mir::monomorphize::{collector, MonoItem};
|
pub use crate::rustc_mir::monomorphize::{collector, MonoItem};
|
||||||
pub use syntax::ast::{FloatTy, IntTy, UintTy};
|
pub use crate::syntax::ast::{FloatTy, IntTy, UintTy};
|
||||||
pub use syntax::source_map::DUMMY_SP;
|
pub use crate::syntax::source_map::DUMMY_SP;
|
||||||
|
|
||||||
pub use cranelift::codegen::ir::{
|
pub use cranelift::codegen::ir::{
|
||||||
condcodes::IntCC, function::Function, ExternalName, FuncRef, Inst, StackSlot,
|
condcodes::IntCC, function::Function, ExternalName, FuncRef, Inst, StackSlot,
|
||||||
@ -373,8 +373,8 @@ fn maybe_create_entry_wrapper<'a, 'tcx: 'a>(
|
|||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
module: &mut Module<impl Backend + 'static>,
|
module: &mut Module<impl Backend + 'static>,
|
||||||
) {
|
) {
|
||||||
use rustc::middle::lang_items::StartFnLangItem;
|
use crate::rustc::middle::lang_items::StartFnLangItem;
|
||||||
use rustc::session::config::EntryFnType;
|
use crate::rustc::session::config::EntryFnType;
|
||||||
|
|
||||||
let (main_def_id, use_start_lang_item) = match *tcx.sess.entry_fn.borrow() {
|
let (main_def_id, use_start_lang_item) = match *tcx.sess.entry_fn.borrow() {
|
||||||
Some((id, _, entry_ty)) => (
|
Some((id, _, entry_ty)) => (
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use rustc::middle::cstore::MetadataLoader;
|
use crate::rustc::middle::cstore::MetadataLoader;
|
||||||
use rustc_data_structures::owning_ref::{self, OwningRef};
|
use crate::rustc_data_structures::owning_ref::{self, OwningRef};
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ pub struct CraneliftMetadataLoader;
|
|||||||
impl MetadataLoader for CraneliftMetadataLoader {
|
impl MetadataLoader for CraneliftMetadataLoader {
|
||||||
fn get_rlib_metadata(
|
fn get_rlib_metadata(
|
||||||
&self,
|
&self,
|
||||||
_target: &::rustc_target::spec::Target,
|
_target: &crate::rustc_target::spec::Target,
|
||||||
path: &Path,
|
path: &Path,
|
||||||
) -> Result<owning_ref::ErasedBoxRef<[u8]>, String> {
|
) -> Result<owning_ref::ErasedBoxRef<[u8]>, String> {
|
||||||
let mut archive = ar::Archive::new(File::open(path).map_err(|e| format!("{:?}", e))?);
|
let mut archive = ar::Archive::new(File::open(path).map_err(|e| format!("{:?}", e))?);
|
||||||
@ -33,7 +33,7 @@ impl MetadataLoader for CraneliftMetadataLoader {
|
|||||||
|
|
||||||
fn get_dylib_metadata(
|
fn get_dylib_metadata(
|
||||||
&self,
|
&self,
|
||||||
_target: &::rustc_target::spec::Target,
|
_target: &crate::rustc_target::spec::Target,
|
||||||
_path: &Path,
|
_path: &Path,
|
||||||
) -> Result<owning_ref::ErasedBoxRef<[u8]>, String> {
|
) -> Result<owning_ref::ErasedBoxRef<[u8]>, String> {
|
||||||
Err("dylib metadata loading is not yet supported".to_string())
|
Err("dylib metadata loading is not yet supported".to_string())
|
||||||
|
@ -82,7 +82,7 @@ fn build_vtable<'a, 'tcx: 'a>(
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
.size_and_align();
|
.size_and_align();
|
||||||
let drop_in_place_fn =
|
let drop_in_place_fn =
|
||||||
fx.get_function_id(::rustc_mir::monomorphize::resolve_drop_in_place(tcx, ty));
|
fx.get_function_id(crate::rustc_mir::monomorphize::resolve_drop_in_place(tcx, ty));
|
||||||
|
|
||||||
let mut components: Vec<_> = vec![Some(drop_in_place_fn), None, None];
|
let mut components: Vec<_> = vec![Some(drop_in_place_fn), None, None];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user