Skip to content

Commit 761324d

Browse files
committed
Move TyCtxt::mk_x to Ty::new_x where applicable
1 parent 744d05c commit 761324d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Diff for: src/intrinsic/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1147,19 +1147,19 @@ fn get_rust_try_fn<'a, 'gcc, 'tcx>(cx: &'a CodegenCx<'gcc, 'tcx>, codegen: &mut
11471147

11481148
// Define the type up front for the signature of the rust_try function.
11491149
let tcx = cx.tcx;
1150-
let i8p = tcx.mk_mut_ptr(tcx.types.i8);
1150+
let i8p = Ty::new_mut_ptr(tcx,tcx.types.i8);
11511151
// `unsafe fn(*mut i8) -> ()`
1152-
let try_fn_ty = tcx.mk_fn_ptr(ty::Binder::dummy(tcx.mk_fn_sig(
1152+
let try_fn_ty = Ty::new_fn_ptr(tcx,ty::Binder::dummy(tcx.mk_fn_sig(
11531153
iter::once(i8p),
1154-
tcx.mk_unit(),
1154+
Ty::new_unit(tcx,),
11551155
false,
11561156
rustc_hir::Unsafety::Unsafe,
11571157
Abi::Rust,
11581158
)));
11591159
// `unsafe fn(*mut i8, *mut i8) -> ()`
1160-
let catch_fn_ty = tcx.mk_fn_ptr(ty::Binder::dummy(tcx.mk_fn_sig(
1160+
let catch_fn_ty = Ty::new_fn_ptr(tcx,ty::Binder::dummy(tcx.mk_fn_sig(
11611161
[i8p, i8p].iter().cloned(),
1162-
tcx.mk_unit(),
1162+
Ty::new_unit(tcx,),
11631163
false,
11641164
rustc_hir::Unsafety::Unsafe,
11651165
Abi::Rust,

Diff for: src/type_of.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
283283
// only wide pointer boxes are handled as pointers
284284
// thin pointer boxes with scalar allocators are handled by the general logic below
285285
ty::Adt(def, substs) if def.is_box() && cx.layout_of(substs.type_at(1)).is_zst() => {
286-
let ptr_ty = cx.tcx.mk_mut_ptr(self.ty.boxed_ty());
286+
let ptr_ty = Ty::new_mut_ptr(cx.tcx,self.ty.boxed_ty());
287287
return cx.layout_of(ptr_ty).scalar_pair_element_gcc_type(cx, index, immediate);
288288
}
289289
_ => {}

0 commit comments

Comments
 (0)