Skip to content

Commit 087385a

Browse files
committed
Sync from rust 0ad927c
2 parents ae0e6e2 + 06ef32c commit 087385a

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

Diff for: src/constant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub(crate) fn eval_mir_constant<'tcx>(
7272
let cv = fx.monomorphize(constant.const_);
7373
// This cannot fail because we checked all required_consts in advance.
7474
let val = cv
75-
.eval(fx.tcx, ty::ParamEnv::reveal_all(), Some(constant.span))
75+
.eval(fx.tcx, ty::ParamEnv::reveal_all(), constant.span)
7676
.expect("erroneous constant missed by mono item collection");
7777
(val, cv.ty())
7878
}

Diff for: src/intrinsics/mod.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,10 @@ fn codegen_regular_intrinsic_call<'tcx>(
728728
| sym::variant_count => {
729729
intrinsic_args!(fx, args => (); intrinsic);
730730

731-
let const_val =
732-
fx.tcx.const_eval_instance(ParamEnv::reveal_all(), instance, None).unwrap();
731+
let const_val = fx
732+
.tcx
733+
.const_eval_instance(ParamEnv::reveal_all(), instance, source_info.span)
734+
.unwrap();
733735
let val = crate::constant::codegen_const_value(fx, const_val, ret.layout().ty);
734736
ret.write_cvalue(fx, val);
735737
}
@@ -755,13 +757,6 @@ fn codegen_regular_intrinsic_call<'tcx>(
755757
ret.write_cvalue(fx, val);
756758
}
757759

758-
sym::ptr_guaranteed_cmp => {
759-
intrinsic_args!(fx, args => (a, b); intrinsic);
760-
761-
let val = crate::num::codegen_ptr_binop(fx, BinOp::Eq, a, b).load_scalar(fx);
762-
ret.write_cvalue(fx, CValue::by_val(val, fx.layout_of(fx.tcx.types.u8)));
763-
}
764-
765760
sym::caller_location => {
766761
intrinsic_args!(fx, args => (); intrinsic);
767762

Diff for: src/intrinsics/simd.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
131131

132132
let idx = generic_args[2]
133133
.expect_const()
134-
.eval(fx.tcx, ty::ParamEnv::reveal_all(), Some(span))
134+
.eval(fx.tcx, ty::ParamEnv::reveal_all(), span)
135135
.unwrap()
136136
.unwrap_branch();
137137

0 commit comments

Comments
 (0)