mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-25 21:34:18 +00:00
Rustup to rustc 1.42.0-nightly (caa231d99
2020-01-08)
This commit is contained in:
parent
6652f466ef
commit
33ad67c124
@ -14,7 +14,7 @@ pub use self::returning::{can_return_to_ssa_var, codegen_return};
|
|||||||
|
|
||||||
// Copied from https://github.com/rust-lang/rust/blob/c2f4c57296f0d929618baed0b0d6eb594abf01eb/src/librustc/ty/layout.rs#L2349
|
// Copied from https://github.com/rust-lang/rust/blob/c2f4c57296f0d929618baed0b0d6eb594abf01eb/src/librustc/ty/layout.rs#L2349
|
||||||
pub fn fn_sig_for_fn_abi<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> ty::PolyFnSig<'tcx> {
|
pub fn fn_sig_for_fn_abi<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> ty::PolyFnSig<'tcx> {
|
||||||
let ty = instance.ty(tcx);
|
let ty = instance.monomorphic_ty(tcx);
|
||||||
match ty.kind {
|
match ty.kind {
|
||||||
ty::FnDef(..) |
|
ty::FnDef(..) |
|
||||||
// Shims currently have type FnPtr. Not sure this should remain.
|
// Shims currently have type FnPtr. Not sure this should remain.
|
||||||
@ -66,7 +66,7 @@ pub fn fn_sig_for_fn_abi<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> t
|
|||||||
tcx.mk_fn_sig(std::iter::once(env_ty),
|
tcx.mk_fn_sig(std::iter::once(env_ty),
|
||||||
ret_ty,
|
ret_ty,
|
||||||
false,
|
false,
|
||||||
rustc::hir::Unsafety::Normal,
|
rustc_hir::Unsafety::Normal,
|
||||||
rustc_target::spec::abi::Abi::Rust
|
rustc_target::spec::abi::Abi::Rust
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -611,7 +611,7 @@ pub fn codegen_drop<'tcx>(fx: &mut FunctionCx<'_, 'tcx, impl Backend>, drop_plac
|
|||||||
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
|
||||||
} else {
|
} else {
|
||||||
let drop_fn_ty = drop_fn.ty(fx.tcx);
|
let drop_fn_ty = drop_fn.monomorphic_ty(fx.tcx);
|
||||||
match ty.kind {
|
match ty.kind {
|
||||||
ty::Dynamic(..) => {
|
ty::Dynamic(..) => {
|
||||||
let (ptr, vtable) = drop_place.to_ptr_maybe_unsized(fx);
|
let (ptr, vtable) = drop_place.to_ptr_maybe_unsized(fx);
|
||||||
@ -636,7 +636,7 @@ pub fn codegen_drop<'tcx>(fx: &mut FunctionCx<'_, 'tcx, impl Backend>, drop_plac
|
|||||||
&ty::RegionKind::ReErased,
|
&ty::RegionKind::ReErased,
|
||||||
TypeAndMut {
|
TypeAndMut {
|
||||||
ty,
|
ty,
|
||||||
mutbl: crate::rustc::hir::Mutability::Mut,
|
mutbl: crate::rustc_hir::Mutability::Mut,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -533,7 +533,7 @@ fn trans_stmt<'tcx>(
|
|||||||
outputs: _,
|
outputs: _,
|
||||||
inputs: _,
|
inputs: _,
|
||||||
} = &**asm;
|
} = &**asm;
|
||||||
let rustc::hir::InlineAsmInner {
|
let rustc_hir::InlineAsmInner {
|
||||||
asm: asm_code, // Name
|
asm: asm_code, // Name
|
||||||
outputs, // Vec<Name>
|
outputs, // Vec<Name>
|
||||||
inputs, // Vec<Name>
|
inputs, // Vec<Name>
|
||||||
|
@ -73,7 +73,7 @@ pub fn clif_type_from_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<types:
|
|||||||
|
|
||||||
/// Is a pointer to this type a fat ptr?
|
/// Is a pointer to this type a fat ptr?
|
||||||
pub fn has_ptr_meta<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
|
pub fn has_ptr_meta<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
|
||||||
let ptr_ty = tcx.mk_ptr(TypeAndMut { ty, mutbl: rustc::hir::Mutability::Not });
|
let ptr_ty = tcx.mk_ptr(TypeAndMut { ty, mutbl: rustc_hir::Mutability::Not });
|
||||||
match &tcx.layout_of(ParamEnv::reveal_all().and(ptr_ty)).unwrap().abi {
|
match &tcx.layout_of(ParamEnv::reveal_all().and(ptr_ty)).unwrap().abi {
|
||||||
Abi::Scalar(_) => false,
|
Abi::Scalar(_) => false,
|
||||||
Abi::ScalarPair(_, _) => true,
|
Abi::ScalarPair(_, _) => true,
|
||||||
|
@ -199,7 +199,7 @@ fn data_id_for_static(
|
|||||||
) -> DataId {
|
) -> DataId {
|
||||||
let instance = Instance::mono(tcx, def_id);
|
let instance = Instance::mono(tcx, def_id);
|
||||||
let symbol_name = tcx.symbol_name(instance).name.as_str();
|
let symbol_name = tcx.symbol_name(instance).name.as_str();
|
||||||
let ty = instance.ty(tcx);
|
let ty = instance.monomorphic_ty(tcx);
|
||||||
let is_mutable = if tcx.is_mutable_static(def_id) {
|
let is_mutable = if tcx.is_mutable_static(def_id) {
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
|
@ -138,7 +138,7 @@ impl<'tcx> DebugContext<'tcx> {
|
|||||||
|
|
||||||
let type_entry = self.dwarf.unit.get_mut(type_id);
|
let type_entry = self.dwarf.unit.get_mut(type_id);
|
||||||
|
|
||||||
//type_entry.set(gimli::DW_AT_mutable, AttributeValue::Flag(mutbl == rustc::hir::Mutability::Mut));
|
//type_entry.set(gimli::DW_AT_mutable, AttributeValue::Flag(mutbl == rustc_hir::Mutability::Mut));
|
||||||
type_entry.set(gimli::DW_AT_type, AttributeValue::ThisUnitEntryRef(pointee));
|
type_entry.set(gimli::DW_AT_type, AttributeValue::ThisUnitEntryRef(pointee));
|
||||||
|
|
||||||
type_id
|
type_id
|
||||||
|
@ -9,6 +9,7 @@ extern crate rustc_codegen_utils;
|
|||||||
extern crate rustc_data_structures;
|
extern crate rustc_data_structures;
|
||||||
extern crate rustc_driver;
|
extern crate rustc_driver;
|
||||||
extern crate rustc_fs_util;
|
extern crate rustc_fs_util;
|
||||||
|
extern crate rustc_hir;
|
||||||
extern crate rustc_incremental;
|
extern crate rustc_incremental;
|
||||||
extern crate rustc_index;
|
extern crate rustc_index;
|
||||||
extern crate rustc_mir;
|
extern crate rustc_mir;
|
||||||
@ -68,7 +69,7 @@ mod prelude {
|
|||||||
pub use rustc_span::{Pos, Span};
|
pub use rustc_span::{Pos, Span};
|
||||||
|
|
||||||
pub use rustc::bug;
|
pub use rustc::bug;
|
||||||
pub use rustc::hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
|
pub use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
|
||||||
pub use rustc::mir::{self, interpret::AllocId, mono::MonoItem, *};
|
pub use rustc::mir::{self, interpret::AllocId, mono::MonoItem, *};
|
||||||
pub use rustc::session::{
|
pub use rustc::session::{
|
||||||
config::{CrateType, Lto},
|
config::{CrateType, Lto},
|
||||||
|
Loading…
Reference in New Issue
Block a user