implement is_accessible_span
This commit is contained in:
parent
17355a3b9f
commit
12d11e9a35
9 changed files with 16 additions and 16 deletions
|
@ -309,7 +309,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
));
|
||||
|
||||
// Check first whether the source is accessible (issue #87060)
|
||||
if self.infcx.tcx.sess.source_map().span_to_snippet(deref_target).is_ok() {
|
||||
if self.infcx.tcx.sess.source_map().is_accessible_span(deref_target) {
|
||||
err.span_note(deref_target, "deref defined here");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -975,14 +975,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()
|
||||
.span_to_snippet(self_arg.span)
|
||||
.is_ok()
|
||||
{
|
||||
if self.infcx.tcx.sess.source_map().is_accessible_span(self_arg.span) {
|
||||
self_arg.span
|
||||
} else {
|
||||
fn_call_span
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue