Skip to content

Commit 6e01157

Browse files
committed
Auto merge of rust-lang#108052 - matthiaskrgr:rollup-p6r6rnl, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang#103478 ( Suggest fix for misplaced generic params on fn item rust-lang#103366 ) - rust-lang#107739 (Check for overflow in evaluate_canonical_goal) - rust-lang#108003 (Avoid ICE when the generic_span is empty) - rust-lang#108016 ("Basic usage" is redundant for there is just one example) - rust-lang#108023 (Shrink size of array benchmarks) - rust-lang#108024 (add message to update Cargo.toml when x is changed) - rust-lang#108025 (rustdoc: add more tooltips to intra-doc links) - rust-lang#108029 (s/eval_usize/eval_target_usize/ for clarity) - rust-lang#108035 (Avoid using a dead email address as the main email address) - rust-lang#108038 (Remove needless supertrait constraints from Interner projections) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9bb6e60 + ea679fb commit 6e01157

File tree

87 files changed

+918
-443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+918
-443
lines changed

.mailmap

+12-12
Original file line numberDiff line numberDiff line change
@@ -419,18 +419,18 @@ Nixon Enraght-Moony <[email protected]>
419419
420420
421421
422-
423-
424-
425-
426-
427-
428-
429-
430-
431-
Oliver Scherer <[email protected]> <public.[email protected]>
432-
433-
Oliver Scherer <[email protected]>
422+
423+
424+
425+
426+
427+
428+
429+
430+
431+
432+
433+
Oliver Scherer <[email protected]>
434434
Ömer Sinan Ağacan <[email protected]>
435435
Ophir LOJKINE <[email protected]>
436436
Ožbolt Menegatti <[email protected]> gareins <[email protected]>

compiler/rustc_borrowck/src/type_check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1782,7 +1782,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
17821782
// than 1.
17831783
// If the length is larger than 1, the repeat expression will need to copy the
17841784
// element, so we require the `Copy` trait.
1785-
if len.try_eval_usize(tcx, self.param_env).map_or(true, |len| len > 1) {
1785+
if len.try_eval_target_usize(tcx, self.param_env).map_or(true, |len| len > 1) {
17861786
match operand {
17871787
Operand::Copy(..) | Operand::Constant(..) => {
17881788
// These are always okay: direct use of a const, or a value that can evidently be copied.

compiler/rustc_codegen_cranelift/src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ fn codegen_stmt<'tcx>(
857857
fn codegen_array_len<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, place: CPlace<'tcx>) -> Value {
858858
match *place.layout().ty.kind() {
859859
ty::Array(_elem_ty, len) => {
860-
let len = fx.monomorphize(len).eval_usize(fx.tcx, ParamEnv::reveal_all()) as i64;
860+
let len = fx.monomorphize(len).eval_target_usize(fx.tcx, ParamEnv::reveal_all()) as i64;
861861
fx.bcx.ins().iconst(fx.pointer_type, len)
862862
}
863863
ty::Slice(_elem_ty) => {

compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
141141
let idx_ty = fx.monomorphize(idx.ty(fx.mir, fx.tcx));
142142
match idx_ty.kind() {
143143
ty::Array(ty, len) if matches!(ty.kind(), ty::Uint(ty::UintTy::U32)) => len
144-
.try_eval_usize(fx.tcx, ty::ParamEnv::reveal_all())
144+
.try_eval_target_usize(fx.tcx, ty::ParamEnv::reveal_all())
145145
.unwrap_or_else(|| {
146146
span_bug!(span, "could not evaluate shuffle index array length")
147147
})
@@ -735,7 +735,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
735735
ty::Uint(i) if i.bit_width() == Some(expected_int_bits) => {}
736736
ty::Array(elem, len)
737737
if matches!(elem.kind(), ty::Uint(ty::UintTy::U8))
738-
&& len.try_eval_usize(fx.tcx, ty::ParamEnv::reveal_all())
738+
&& len.try_eval_target_usize(fx.tcx, ty::ParamEnv::reveal_all())
739739
== Some(expected_bytes) => {}
740740
_ => {
741741
fx.tcx.sess.span_fatal(

compiler/rustc_codegen_cranelift/src/unsize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub(crate) fn unsized_info<'tcx>(
2424
(&ty::Array(_, len), &ty::Slice(_)) => fx
2525
.bcx
2626
.ins()
27-
.iconst(fx.pointer_type, len.eval_usize(fx.tcx, ParamEnv::reveal_all()) as i64),
27+
.iconst(fx.pointer_type, len.eval_target_usize(fx.tcx, ParamEnv::reveal_all()) as i64),
2828
(
2929
&ty::Dynamic(ref data_a, _, src_dyn_kind),
3030
&ty::Dynamic(ref data_b, _, target_dyn_kind),

compiler/rustc_codegen_cranelift/src/value_and_place.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,8 @@ impl<'tcx> CPlace<'tcx> {
564564
CPlaceInner::Var(_local, var) => {
565565
if let ty::Array(element, len) = dst_layout.ty.kind() {
566566
// Can only happen for vector types
567-
let len =
568-
u32::try_from(len.eval_usize(fx.tcx, ParamEnv::reveal_all())).unwrap();
567+
let len = u32::try_from(len.eval_target_usize(fx.tcx, ParamEnv::reveal_all()))
568+
.unwrap();
569569
let vector_ty = fx.clif_type(*element).unwrap().by(len).unwrap();
570570

571571
let data = match from.0 {

0 commit comments

Comments
 (0)