Skip to content

Commit

Permalink
Auto merge of rust-lang#108052 - matthiaskrgr:rollup-p6r6rnl, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

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
  • Loading branch information
bors committed Feb 14, 2023
2 parents 9bb6e60 + ea679fb commit 6e01157
Show file tree
Hide file tree
Showing 87 changed files with 918 additions and 443 deletions.
24 changes: 12 additions & 12 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -419,18 +419,18 @@ Nixon Enraght-Moony <nixon.emoony@gmail.com>
NODA Kai <nodakai@gmail.com>
oliver <16816606+o752d@users.noreply.github.com>
Oliver Middleton <olliemail27@gmail.com> <ollie27@users.noreply.github.com>
Oliver Scherer <oliver.schneider@kit.edu> <git-spam-no-reply9815368754983@oli-obk.de>
Oliver Scherer <oliver.schneider@kit.edu> <git-spam9815368754983@oli-obk.de>
Oliver Scherer <oliver.schneider@kit.edu> <github333195615777966@oli-obk.de>
Oliver Scherer <oliver.schneider@kit.edu> <rust19446194516@oli-obk.de>
Oliver Scherer <oliver.schneider@kit.edu> <git-no-reply-9879165716479413131@oli-obk.de>
Oliver Scherer <oliver.schneider@kit.edu> <git1984941651981@oli-obk.de>
Oliver Scherer <oliver.schneider@kit.edu> <github35764891676564198441@oli-obk.de>
Oliver Scherer <oliver.schneider@kit.edu> <github6541940@oli-obk.de>
Oliver Scherer <oliver.schneider@kit.edu> <oli-obk@users.noreply.github.com>
Oliver Scherer <oliver.schneider@kit.edu> <public.oliver.schneider@kit.edu>
Oliver Scherer <oliver.schneider@kit.edu> <obk8176014uqher834@olio-obk.de>
Oliver Scherer <oliver.schneider@kit.edu>
Oliver Scherer <oli-obk@users.noreply.github.com> <git-spam-no-reply9815368754983@oli-obk.de>
Oliver Scherer <oli-obk@users.noreply.github.com> <git-spam9815368754983@oli-obk.de>
Oliver Scherer <oli-obk@users.noreply.github.com> <github333195615777966@oli-obk.de>
Oliver Scherer <oli-obk@users.noreply.github.com> <rust19446194516@oli-obk.de>
Oliver Scherer <oli-obk@users.noreply.github.com> <git-no-reply-9879165716479413131@oli-obk.de>
Oliver Scherer <oli-obk@users.noreply.github.com> <git1984941651981@oli-obk.de>
Oliver Scherer <oli-obk@users.noreply.github.com> <github35764891676564198441@oli-obk.de>
Oliver Scherer <oli-obk@users.noreply.github.com> <github6541940@oli-obk.de>
Oliver Scherer <oli-obk@users.noreply.github.com> <public.oliver.schneider@kit.edu>
Oliver Scherer <oli-obk@users.noreply.github.com> <oliver.schneider@kit.edu>
Oliver Scherer <oli-obk@users.noreply.github.com> <obk8176014uqher834@olio-obk.de>
Oliver Scherer <oli-obk@users.noreply.github.com>
Ömer Sinan Ağacan <omeragacan@gmail.com>
Ophir LOJKINE <pere.jobs@gmail.com>
Ožbolt Menegatti <ozbolt.menegatti@gmail.com> gareins <ozbolt.menegatti@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
// than 1.
// If the length is larger than 1, the repeat expression will need to copy the
// element, so we require the `Copy` trait.
if len.try_eval_usize(tcx, self.param_env).map_or(true, |len| len > 1) {
if len.try_eval_target_usize(tcx, self.param_env).map_or(true, |len| len > 1) {
match operand {
Operand::Copy(..) | Operand::Constant(..) => {
// These are always okay: direct use of a const, or a value that can evidently be copied.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ fn codegen_stmt<'tcx>(
fn codegen_array_len<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, place: CPlace<'tcx>) -> Value {
match *place.layout().ty.kind() {
ty::Array(_elem_ty, len) => {
let len = fx.monomorphize(len).eval_usize(fx.tcx, ParamEnv::reveal_all()) as i64;
let len = fx.monomorphize(len).eval_target_usize(fx.tcx, ParamEnv::reveal_all()) as i64;
fx.bcx.ins().iconst(fx.pointer_type, len)
}
ty::Slice(_elem_ty) => {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
let idx_ty = fx.monomorphize(idx.ty(fx.mir, fx.tcx));
match idx_ty.kind() {
ty::Array(ty, len) if matches!(ty.kind(), ty::Uint(ty::UintTy::U32)) => len
.try_eval_usize(fx.tcx, ty::ParamEnv::reveal_all())
.try_eval_target_usize(fx.tcx, ty::ParamEnv::reveal_all())
.unwrap_or_else(|| {
span_bug!(span, "could not evaluate shuffle index array length")
})
Expand Down Expand Up @@ -735,7 +735,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
ty::Uint(i) if i.bit_width() == Some(expected_int_bits) => {}
ty::Array(elem, len)
if matches!(elem.kind(), ty::Uint(ty::UintTy::U8))
&& len.try_eval_usize(fx.tcx, ty::ParamEnv::reveal_all())
&& len.try_eval_target_usize(fx.tcx, ty::ParamEnv::reveal_all())
== Some(expected_bytes) => {}
_ => {
fx.tcx.sess.span_fatal(
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/unsize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub(crate) fn unsized_info<'tcx>(
(&ty::Array(_, len), &ty::Slice(_)) => fx
.bcx
.ins()
.iconst(fx.pointer_type, len.eval_usize(fx.tcx, ParamEnv::reveal_all()) as i64),
.iconst(fx.pointer_type, len.eval_target_usize(fx.tcx, ParamEnv::reveal_all()) as i64),
(
&ty::Dynamic(ref data_a, _, src_dyn_kind),
&ty::Dynamic(ref data_b, _, target_dyn_kind),
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_cranelift/src/value_and_place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,8 @@ impl<'tcx> CPlace<'tcx> {
CPlaceInner::Var(_local, var) => {
if let ty::Array(element, len) = dst_layout.ty.kind() {
// Can only happen for vector types
let len =
u32::try_from(len.eval_usize(fx.tcx, ParamEnv::reveal_all())).unwrap();
let len = u32::try_from(len.eval_target_usize(fx.tcx, ParamEnv::reveal_all()))
.unwrap();
let vector_ty = fx.clif_type(*element).unwrap().by(len).unwrap();

let data = match from.0 {
Expand Down
Loading

0 comments on commit 6e01157

Please sign in to comment.