Skip to content

Commit 67c8877

Browse files
committed
Auto merge of #133212 - lcnr:questionable-uwu, r=compiler-errors
continue `ParamEnv` to `TypingEnv` transition cc #132279 r? `@compiler-errors`
2 parents c5c3709 + bf45e9f commit 67c8877

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/base.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
1111
use rustc_middle::mir::InlineAsmMacro;
1212
use rustc_middle::ty::TypeVisitableExt;
1313
use rustc_middle::ty::adjustment::PointerCoercion;
14-
use rustc_middle::ty::layout::FnAbiOf;
14+
use rustc_middle::ty::layout::{FnAbiOf, HasTypingEnv};
1515
use rustc_middle::ty::print::with_no_trimmed_paths;
1616

1717
use crate::constant::ConstantCx;
@@ -841,7 +841,7 @@ fn codegen_stmt<'tcx>(
841841
lval.write_cvalue(fx, CValue::by_val(operand, box_layout));
842842
}
843843
Rvalue::NullaryOp(ref null_op, ty) => {
844-
assert!(lval.layout().ty.is_sized(fx.tcx, ty::ParamEnv::reveal_all()));
844+
assert!(lval.layout().ty.is_sized(fx.tcx, fx.typing_env()));
845845
let layout = fx.layout_of(fx.monomorphize(ty));
846846
let val = match null_op {
847847
NullOp::SizeOf => layout.size.bytes(),

src/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ fn clif_pair_type_from_ty<'tcx>(
103103

104104
/// Is a pointer to this type a wide ptr?
105105
pub(crate) fn has_ptr_meta<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
106-
if ty.is_sized(tcx, ty::ParamEnv::reveal_all()) {
106+
if ty.is_sized(tcx, ty::TypingEnv::fully_monomorphized()) {
107107
return false;
108108
}
109109

src/intrinsics/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,11 @@ fn codegen_regular_intrinsic_call<'tcx>(
744744

745745
let const_val = fx
746746
.tcx
747-
.const_eval_instance(ty::ParamEnv::reveal_all(), instance, source_info.span)
747+
.const_eval_instance(
748+
ty::TypingEnv::fully_monomorphized(),
749+
instance,
750+
source_info.span,
751+
)
748752
.unwrap();
749753
let val = crate::constant::codegen_const_value(fx, const_val, ret.layout().ty);
750754
ret.write_cvalue(fx, val);

0 commit comments

Comments
 (0)