Skip to content

Commit d4c7839

Browse files
committedApr 5, 2022
Auto merge of #95680 - Dylan-DPC:rollup-7jldtnz, r=Dylan-DPC
Rollup of 4 pull requests Successful merges: - #95525 (Suggest derivable trait on E0277 error) - #95654 (diagnostics: use correct span for const generics) - #95660 (Update panic docs to make it clearer when to use panic vs Result) - #95670 (Refactor: remove unused function parameters) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 634770c + 6832964 commit d4c7839

File tree

95 files changed

+453
-75
lines changed

Some content is hidden

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

95 files changed

+453
-75
lines changed
 

‎compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2068,7 +2068,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
20682068
hir::GenericParam {
20692069
hir_id,
20702070
name,
2071-
span: self.lower_span(param.ident.span),
2071+
span: self.lower_span(param.span()),
20722072
pure_wrt_drop: self.sess.contains_name(&param.attrs, sym::may_dangle),
20732073
bounds: self.arena.alloc_from_iter(bounds),
20742074
kind,

‎compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -772,14 +772,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
772772
Some((issued_span, span)),
773773
);
774774

775-
self.suggest_using_local_if_applicable(
776-
&mut err,
777-
location,
778-
(place, span),
779-
gen_borrow_kind,
780-
issued_borrow,
781-
explanation,
782-
);
775+
self.suggest_using_local_if_applicable(&mut err, location, issued_borrow, explanation);
783776

784777
err
785778
}
@@ -789,8 +782,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
789782
&self,
790783
err: &mut Diagnostic,
791784
location: Location,
792-
(place, span): (Place<'tcx>, Span),
793-
gen_borrow_kind: BorrowKind,
794785
issued_borrow: &BorrowData<'tcx>,
795786
explanation: BorrowExplanation,
796787
) {
@@ -822,7 +813,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
822813
return;
823814
};
824815
let inner_param_uses = find_all_local_uses::find(self.body, inner_param.local);
825-
let Some((inner_call_loc,inner_call_term)) = inner_param_uses.into_iter().find_map(|loc| {
816+
let Some((inner_call_loc, inner_call_term)) = inner_param_uses.into_iter().find_map(|loc| {
826817
let Either::Right(term) = self.body.stmt_at(loc) else {
827818
debug!("{:?} is a statement, so it can't be a call", loc);
828819
return None;
@@ -833,7 +824,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
833824
};
834825
debug!("checking call args for uses of inner_param: {:?}", args);
835826
if args.contains(&Operand::Move(inner_param)) {
836-
Some((loc,term))
827+
Some((loc, term))
837828
} else {
838829
None
839830
}

0 commit comments

Comments
 (0)
Please sign in to comment.