You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
note_spans.push_span_label(private_struct_span,"in this struct");
409
+
}
410
+
if private_field_span != DUMMY_SP{
411
+
note_spans.push_span_label(
412
+
private_field_span,
413
+
"if this field wasn't private, it would be accessible",
414
+
);
415
+
}
416
+
if accessible_struct_span != DUMMY_SP{
417
+
note_spans.push_span_label(
418
+
accessible_struct_span,
419
+
"this struct is accessible through auto-deref",
420
+
);
421
+
}
422
+
if field_span != DUMMY_SP{
423
+
note_spans
424
+
.push_span_label(field_span,"this is the field that was accessed");
425
+
}
426
+
ifletSome(deref_impl_span) = deref_impl_span
427
+
&& deref_impl_span != DUMMY_SP
428
+
{
429
+
note_spans.push_span_label(
430
+
deref_impl_span,
431
+
"the field was accessed through this `Deref`",
432
+
);
433
+
}
434
+
435
+
err.span_note(
436
+
note_spans,
437
+
format!(
438
+
"there is a field `{field_ident}` on `{private_base_ty}` with type `{private_field_ty}` but it is private; `{field_ident}` from `{deref_base_ty}` was accessed through auto-deref instead"
439
+
),
440
+
);
359
441
}
442
+
443
+
// we finally get to the accessible field,
444
+
// so we can return early without checking the rest of the autoderef candidates
0 commit comments