Eagerly convert some ctors to use their specialized ctors
This commit is contained in:
@@ -5,7 +5,7 @@ use rustc_middle::mir::{
|
||||
interpret::Scalar,
|
||||
visit::{MutatingUseContext, NonMutatingUseContext, PlaceContext, Visitor},
|
||||
};
|
||||
use rustc_middle::ty::{self, ParamEnv, Ty, TyCtxt, TypeAndMut};
|
||||
use rustc_middle::ty::{self, ParamEnv, Ty, TyCtxt};
|
||||
use rustc_session::Session;
|
||||
|
||||
pub struct CheckAlignment;
|
||||
@@ -157,7 +157,7 @@ fn insert_alignment_check<'tcx>(
|
||||
new_block: BasicBlock,
|
||||
) {
|
||||
// Cast the pointer to a *const ()
|
||||
let const_raw_ptr = Ty::new_ptr(tcx, TypeAndMut { ty: tcx.types.unit, mutbl: Mutability::Not });
|
||||
let const_raw_ptr = Ty::new_imm_ptr(tcx, tcx.types.unit);
|
||||
let rvalue = Rvalue::Cast(CastKind::PtrToPtr, Operand::Copy(pointer), const_raw_ptr);
|
||||
let thin_ptr = local_decls.push(LocalDecl::with_source_info(const_raw_ptr, source_info)).into();
|
||||
block_data
|
||||
|
||||
Reference in New Issue
Block a user