mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-19 10:24:16 +00:00
Auto merge of #133212 - lcnr:questionable-uwu, r=compiler-errors
continue `ParamEnv` to `TypingEnv` transition cc #132279 r? `@compiler-errors`
This commit is contained in:
commit
67c8877102
@ -11,7 +11,7 @@ use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
|
|||||||
use rustc_middle::mir::InlineAsmMacro;
|
use rustc_middle::mir::InlineAsmMacro;
|
||||||
use rustc_middle::ty::TypeVisitableExt;
|
use rustc_middle::ty::TypeVisitableExt;
|
||||||
use rustc_middle::ty::adjustment::PointerCoercion;
|
use rustc_middle::ty::adjustment::PointerCoercion;
|
||||||
use rustc_middle::ty::layout::FnAbiOf;
|
use rustc_middle::ty::layout::{FnAbiOf, HasTypingEnv};
|
||||||
use rustc_middle::ty::print::with_no_trimmed_paths;
|
use rustc_middle::ty::print::with_no_trimmed_paths;
|
||||||
|
|
||||||
use crate::constant::ConstantCx;
|
use crate::constant::ConstantCx;
|
||||||
@ -841,7 +841,7 @@ fn codegen_stmt<'tcx>(
|
|||||||
lval.write_cvalue(fx, CValue::by_val(operand, box_layout));
|
lval.write_cvalue(fx, CValue::by_val(operand, box_layout));
|
||||||
}
|
}
|
||||||
Rvalue::NullaryOp(ref null_op, ty) => {
|
Rvalue::NullaryOp(ref null_op, ty) => {
|
||||||
assert!(lval.layout().ty.is_sized(fx.tcx, ty::ParamEnv::reveal_all()));
|
assert!(lval.layout().ty.is_sized(fx.tcx, fx.typing_env()));
|
||||||
let layout = fx.layout_of(fx.monomorphize(ty));
|
let layout = fx.layout_of(fx.monomorphize(ty));
|
||||||
let val = match null_op {
|
let val = match null_op {
|
||||||
NullOp::SizeOf => layout.size.bytes(),
|
NullOp::SizeOf => layout.size.bytes(),
|
||||||
|
@ -103,7 +103,7 @@ fn clif_pair_type_from_ty<'tcx>(
|
|||||||
|
|
||||||
/// Is a pointer to this type a wide ptr?
|
/// Is a pointer to this type a wide ptr?
|
||||||
pub(crate) fn has_ptr_meta<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
|
pub(crate) fn has_ptr_meta<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
|
||||||
if ty.is_sized(tcx, ty::ParamEnv::reveal_all()) {
|
if ty.is_sized(tcx, ty::TypingEnv::fully_monomorphized()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -744,7 +744,11 @@ fn codegen_regular_intrinsic_call<'tcx>(
|
|||||||
|
|
||||||
let const_val = fx
|
let const_val = fx
|
||||||
.tcx
|
.tcx
|
||||||
.const_eval_instance(ty::ParamEnv::reveal_all(), instance, source_info.span)
|
.const_eval_instance(
|
||||||
|
ty::TypingEnv::fully_monomorphized(),
|
||||||
|
instance,
|
||||||
|
source_info.span,
|
||||||
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let val = crate::constant::codegen_const_value(fx, const_val, ret.layout().ty);
|
let val = crate::constant::codegen_const_value(fx, const_val, ret.layout().ty);
|
||||||
ret.write_cvalue(fx, val);
|
ret.write_cvalue(fx, val);
|
||||||
|
Loading…
Reference in New Issue
Block a user