1
Fork 0

Stop pointing to operators if their libcore method source is not available

This commit is contained in:
Oli Scherer 2022-12-12 15:36:08 +00:00
parent 59554a2b54
commit 6984085088
5 changed files with 16 additions and 70 deletions

View file

@ -1059,12 +1059,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
);
if self.fn_self_span_reported.insert(fn_span) {
err.span_note(
// Check whether the source is accessible
if self.infcx.tcx.sess.source_map().is_span_accessible(self_arg.span) {
self_arg.span
} else {
fn_call_span
},
self_arg.span,
"calling this operator moves the left-hand side",
);
}