Rustup to rustc 1.42.0-nightly (fc5deca21 2019-12-21)
This commit is contained in:
parent
2485994803
commit
e63a94fca6
@ -633,7 +633,7 @@ pub fn codegen_drop<'tcx>(fx: &mut FunctionCx<'_, 'tcx, impl Backend>, drop_plac
|
||||
&ty::RegionKind::ReErased,
|
||||
TypeAndMut {
|
||||
ty,
|
||||
mutbl: crate::rustc::hir::Mutability::Mutable,
|
||||
mutbl: crate::rustc::hir::Mutability::Mut,
|
||||
},
|
||||
),
|
||||
);
|
||||
|
@ -72,7 +72,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?
|
||||
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::Immutable });
|
||||
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 {
|
||||
Abi::Scalar(_) => false,
|
||||
Abi::ScalarPair(_, _) => true,
|
||||
|
@ -138,7 +138,7 @@ impl<'tcx> DebugContext<'tcx> {
|
||||
|
||||
let type_entry = self.dwarf.unit.get_mut(type_id);
|
||||
|
||||
//type_entry.set(gimli::DW_AT_mutable, AttributeValue::Flag(mutbl == rustc::hir::Mutability::MutMutable));
|
||||
//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_id
|
||||
|
@ -346,8 +346,6 @@ impl<'tcx> CPlace<'tcx> {
|
||||
}
|
||||
|
||||
pub fn write_cvalue(self, fx: &mut FunctionCx<'_, 'tcx, impl Backend>, from: CValue<'tcx>) {
|
||||
use rustc::hir::Mutability::*;
|
||||
|
||||
let from_ty = from.layout().ty;
|
||||
let to_ty = self.layout().ty;
|
||||
|
||||
@ -357,14 +355,14 @@ impl<'tcx> CPlace<'tcx> {
|
||||
to_ty: Ty<'tcx>,
|
||||
) {
|
||||
match (&from_ty.kind, &to_ty.kind) {
|
||||
(ty::Ref(_, t, Immutable), ty::Ref(_, u, Immutable))
|
||||
| (ty::Ref(_, t, Mutable), ty::Ref(_, u, Immutable))
|
||||
| (ty::Ref(_, t, Mutable), ty::Ref(_, u, Mutable)) => {
|
||||
(ty::Ref(_, t, Mutability::Not), ty::Ref(_, u, Mutability::Not))
|
||||
| (ty::Ref(_, t, Mutability::Mut), ty::Ref(_, u, Mutability::Not))
|
||||
| (ty::Ref(_, t, Mutability::Mut), ty::Ref(_, u, Mutability::Mut)) => {
|
||||
assert_assignable(fx, t, u);
|
||||
// &mut T -> &T is allowed
|
||||
// &'a T -> &'b T is allowed
|
||||
}
|
||||
(ty::Ref(_, _, Immutable), ty::Ref(_, _, Mutable)) => panic!(
|
||||
(ty::Ref(_, _, Mutability::Not), ty::Ref(_, _, Mutability::Mut)) => panic!(
|
||||
"Cant assign value of type {} to place of type {}",
|
||||
from_ty, to_ty
|
||||
),
|
||||
|
3
test.sh
3
test.sh
@ -52,7 +52,8 @@ $RUSTC example/alloc_example.rs --crate-type bin
|
||||
jit std_example example/std_example.rs
|
||||
|
||||
echo "[AOT] dst_field_align"
|
||||
$RUSTC example/dst-field-align.rs -Zmir-opt-level=2 --crate-name dst_field_align --crate-type bin
|
||||
# FIXME Re-add -Zmir-opt-level=2 once rust-lang/rust#67529 is fixed.
|
||||
$RUSTC example/dst-field-align.rs --crate-name dst_field_align --crate-type bin
|
||||
./target/out/dst_field_align
|
||||
|
||||
echo "[AOT] std_example"
|
||||
|
Loading…
x
Reference in New Issue
Block a user