Skip to content

Commit d7dcadc

Browse files
committedJun 20, 2023
Auto merge of #112817 - compiler-errors:rollup-0eqomra, r=compiler-errors
Rollup of 8 pull requests Successful merges: - #112232 (Better error for non const `PartialEq` call generated by `match`) - #112499 (Fix python linting errors) - #112596 (Suggest correct signature on missing fn returning RPITIT/AFIT) - #112606 (Alter `Display` for `Ipv6Addr` for IPv4-compatible addresses) - #112781 (Don't consider TAIT normalizable to hidden ty if it would result in impossible item bounds) - #112787 (Add gha problem matcher) - #112799 (Clean up "doc(hidden)" check) - #112803 (Format the examples directory of cg_clif) r? `@ghost` `@rustbot` modify labels: rollup
·
1.88.01.72.0
2 parents 14803bd + 0ca3252 commit d7dcadc

File tree

75 files changed

+462
-190
lines changed

Some content is hidden

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

75 files changed

+462
-190
lines changed
 

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use rustc_infer::traits::ObligationCause;
1414
use rustc_middle::hir::nested_filter::OnlyBodies;
1515
use rustc_middle::mir::tcx::PlaceTy;
1616
use rustc_middle::mir::{
17-
self, AggregateKind, BindingForm, BorrowKind, ClearCrossCrate, ConstraintCategory,
17+
self, AggregateKind, BindingForm, BorrowKind, CallSource, ClearCrossCrate, ConstraintCategory,
1818
FakeReadCause, LocalDecl, LocalInfo, LocalKind, Location, Operand, Place, PlaceRef,
1919
ProjectionElem, Rvalue, Statement, StatementKind, Terminator, TerminatorKind, VarBindingForm,
2020
};
@@ -2579,7 +2579,10 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
25792579
fn explain_deref_coercion(&mut self, loan: &BorrowData<'tcx>, err: &mut Diagnostic) {
25802580
let tcx = self.infcx.tcx;
25812581
if let (
2582-
Some(Terminator { kind: TerminatorKind::Call { from_hir_call: false, .. }, .. }),
2582+
Some(Terminator {
2583+
kind: TerminatorKind::Call { call_source: CallSource::OverloadedOperator, .. },
2584+
..
2585+
}),
25832586
Some((method_did, method_substs)),
25842587
) = (
25852588
&self.body[loan.reserve_location.block].terminator,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use rustc_hir::intravisit::Visitor;
66
use rustc_index::IndexSlice;
77
use rustc_infer::infer::NllRegionVariableOrigin;
88
use rustc_middle::mir::{
9-
Body, CastKind, ConstraintCategory, FakeReadCause, Local, LocalInfo, Location, Operand, Place,
10-
Rvalue, Statement, StatementKind, TerminatorKind,
9+
Body, CallSource, CastKind, ConstraintCategory, FakeReadCause, Local, LocalInfo, Location,
10+
Operand, Place, Rvalue, Statement, StatementKind, TerminatorKind,
1111
};
1212
use rustc_middle::ty::adjustment::PointerCast;
1313
use rustc_middle::ty::{self, RegionVid, TyCtxt};
@@ -494,7 +494,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
494494
} else if self.was_captured_by_trait_object(borrow) {
495495
LaterUseKind::TraitCapture
496496
} else if location.statement_index == block.statements.len() {
497-
if let TerminatorKind::Call { func, from_hir_call: true, .. } =
497+
if let TerminatorKind::Call { func, call_source: CallSource::Normal, .. } =
498498
&block.terminator().kind
499499
{
500500
// Just point to the function, to reduce the chance of overlapping spans.

0 commit comments

Comments
 (0)
Please sign in to comment.