Skip to content

Commit 9f1bfe5

Browse files
committed
Auto merge of rust-lang#118900 - workingjubilee:rollup-wkv9hq1, r=workingjubilee
Rollup of 10 pull requests Successful merges: - rust-lang#118858 (Remove dead codes in core) - rust-lang#118864 (Fix alignment passed down to LLVM for simd_masked_load) - rust-lang#118872 (Add rustX check to codeblock attributes lint) - rust-lang#118873 (fix `waker_getters` tracking issue number) - rust-lang#118884 (NFC: simplify merging of two vecs) - rust-lang#118885 (clippy::complexity fixes) - rust-lang#118886 (Clean up variables in `search.js`) - rust-lang#118887 (Typo) - rust-lang#118889 (more clippy::complexity fixes) - rust-lang#118891 (Actually parse async gen blocks correctly) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 77d1699 + f9078a4 commit 9f1bfe5

File tree

37 files changed

+307
-171
lines changed

37 files changed

+307
-171
lines changed

compiler/rustc_codegen_llvm/src/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
15681568

15691569
// Alignment of T, must be a constant integer value:
15701570
let alignment_ty = bx.type_i32();
1571-
let alignment = bx.const_i32(bx.align_of(values_ty).bytes() as i32);
1571+
let alignment = bx.const_i32(bx.align_of(values_elem).bytes() as i32);
15721572

15731573
// Truncate the mask vector to a vector of i1s:
15741574
let (mask, mask_ty) = {

compiler/rustc_const_eval/src/interpret/visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub trait ValueVisitor<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>>: Sized {
2121
/// `read_discriminant` can be hooked for better error messages.
2222
#[inline(always)]
2323
fn read_discriminant(&mut self, v: &Self::V) -> InterpResult<'tcx, VariantIdx> {
24-
Ok(self.ecx().read_discriminant(&v.to_op(self.ecx())?)?)
24+
self.ecx().read_discriminant(&v.to_op(self.ecx())?)
2525
}
2626

2727
/// This function provides the chance to reorder the order in which fields are visited for

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,10 +587,8 @@ fn show_md_content_with_pager(content: &str, color: ColorConfig) {
587587
let mut print_formatted = if pager_name == "less" {
588588
cmd.arg("-r");
589589
true
590-
} else if ["bat", "catbat", "delta"].iter().any(|v| *v == pager_name) {
591-
true
592590
} else {
593-
false
591+
["bat", "catbat", "delta"].iter().any(|v| *v == pager_name)
594592
};
595593

596594
if color == ColorConfig::Never {

compiler/rustc_hir_analysis/src/collect/item_bounds.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,14 @@ fn associated_type_bounds<'tcx>(
3434
let trait_def_id = tcx.local_parent(assoc_item_def_id);
3535
let trait_predicates = tcx.trait_explicit_predicates_and_bounds(trait_def_id);
3636

37-
let bounds_from_parent = trait_predicates
38-
.predicates
39-
.iter()
40-
.copied()
41-
.filter(|(pred, _)| match pred.kind().skip_binder() {
37+
let bounds_from_parent = trait_predicates.predicates.iter().copied().filter(|(pred, _)| {
38+
match pred.kind().skip_binder() {
4239
ty::ClauseKind::Trait(tr) => tr.self_ty() == item_ty,
4340
ty::ClauseKind::Projection(proj) => proj.projection_ty.self_ty() == item_ty,
4441
ty::ClauseKind::TypeOutlives(outlives) => outlives.0 == item_ty,
4542
_ => false,
46-
})
47-
.map(|(clause, span)| (clause, span));
43+
}
44+
});
4845

4946
let all_bounds = tcx.arena.alloc_from_iter(bounds.clauses().chain(bounds_from_parent));
5047
debug!(

compiler/rustc_hir_typeck/src/coercion.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,7 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
17011701
&& !ty.is_never()
17021702
{
17031703
let indentation = if let None = block.expr
1704-
&& let [.., last] = &block.stmts[..]
1704+
&& let [.., last] = &block.stmts
17051705
{
17061706
tcx.sess.source_map().indentation_before(last.span).unwrap_or_else(String::new)
17071707
} else if let Some(expr) = block.expr {
@@ -1710,7 +1710,7 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
17101710
String::new()
17111711
};
17121712
if let None = block.expr
1713-
&& let [.., last] = &block.stmts[..]
1713+
&& let [.., last] = &block.stmts
17141714
{
17151715
err.span_suggestion_verbose(
17161716
last.span.shrink_to_hi(),
@@ -1750,7 +1750,7 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
17501750
}
17511751
}
17521752
if let None = block.expr
1753-
&& let [.., last] = &block.stmts[..]
1753+
&& let [.., last] = &block.stmts
17541754
{
17551755
sugg.push((last.span.shrink_to_hi(), format!("\n{indentation}None")));
17561756
} else if let Some(expr) = block.expr {

compiler/rustc_hir_typeck/src/demand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
862862
mutability,
863863
),
864864
),
865-
match &args[..] {
865+
match &args {
866866
[] => (base.span.shrink_to_hi().with_hi(deref.span.hi()), ")".to_string()),
867867
[first, ..] => (base.span.between(first.span), ", ".to_string()),
868868
},

compiler/rustc_hir_typeck/src/upvar.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
315315
let final_tupled_upvars_type = Ty::new_tup(self.tcx, &final_upvar_tys);
316316
self.demand_suptype(span, args.tupled_upvars_ty(), final_tupled_upvars_type);
317317

318-
let fake_reads = delegate
319-
.fake_reads
320-
.into_iter()
321-
.map(|(place, cause, hir_id)| (place, cause, hir_id))
322-
.collect();
318+
let fake_reads = delegate.fake_reads;
319+
323320
self.typeck_results.borrow_mut().closure_fake_reads.insert(closure_def_id, fake_reads);
324321

325322
if self.tcx.sess.opts.unstable_opts.profile_closures {

compiler/rustc_infer/src/infer/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2452,7 +2452,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
24522452

24532453
if !suggs.is_empty() {
24542454
err.multipart_suggestion_verbose(
2455-
format!("{msg}"),
2455+
msg,
24562456
suggs,
24572457
Applicability::MaybeIncorrect, // Issue #41966
24582458
);

compiler/rustc_mir_build/src/thir/pattern/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
174174
span: Span,
175175
) -> Result<PatKind<'tcx>, ErrorGuaranteed> {
176176
if lo_expr.is_none() && hi_expr.is_none() {
177-
let msg = format!("found twice-open range pattern (`..`) outside of error recovery");
177+
let msg = "found twice-open range pattern (`..`) outside of error recovery";
178178
return Err(self.tcx.sess.span_delayed_bug(span, msg));
179179
}
180180

compiler/rustc_mir_transform/src/jump_threading.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ impl OpportunitySet {
649649

650650
// `succ` must be a successor of `current`. If it is not, this means this TO is not
651651
// satisfiable and a previous TO erased this edge, so we bail out.
652-
if basic_blocks[current].terminator().successors().find(|s| *s == succ).is_none() {
652+
if !basic_blocks[current].terminator().successors().any(|s| s == succ) {
653653
debug!("impossible");
654654
return;
655655
}

0 commit comments

Comments
 (0)