diff --git a/src/abi/mod.rs b/src/abi/mod.rs index c626ddfc184..28cc04bd484 100644 --- a/src/abi/mod.rs +++ b/src/abi/mod.rs @@ -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, }, ), ); diff --git a/src/common.rs b/src/common.rs index c3a8b708ab6..d0c3385df6c 100644 --- a/src/common.rs +++ b/src/common.rs @@ -72,7 +72,7 @@ pub fn clif_type_from_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option(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, diff --git a/src/debuginfo/mod.rs b/src/debuginfo/mod.rs index 3e69ba1a6cc..2e40e7c4cad 100644 --- a/src/debuginfo/mod.rs +++ b/src/debuginfo/mod.rs @@ -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 diff --git a/src/value_and_place.rs b/src/value_and_place.rs index 4ac81648700..b1e96d2ce2c 100644 --- a/src/value_and_place.rs +++ b/src/value_and_place.rs @@ -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 ), diff --git a/test.sh b/test.sh index 88a86bcf404..e502a20db5b 100755 --- a/test.sh +++ b/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"