pub struct BorrowError {
pub kind: BorrowErrorKind,
pub span: Span,
pub conflicting_loan: LoanId,
pub loan_span: Span,
pub last_use_span: Option<Span>,
pub repairs: Vec<RepairCandidate>,
}Expand description
A borrow conflict error with structured data for diagnostics. The diagnostic engine formats this; consumers never generate error text.
Fields§
§kind: BorrowErrorKind§span: SpanPrimary span (the conflicting operation).
conflicting_loan: LoanIdThe loan that conflicts.
loan_span: SpanWhere the conflicting loan was created.
last_use_span: Option<Span>Where the loan is still needed (last use).
repairs: Vec<RepairCandidate>Repair candidates, ordered by preference.
Trait Implementations§
Source§impl Clone for BorrowError
impl Clone for BorrowError
Auto Trait Implementations§
impl Freeze for BorrowError
impl RefUnwindSafe for BorrowError
impl Send for BorrowError
impl Sync for BorrowError
impl Unpin for BorrowError
impl UnsafeUnpin for BorrowError
impl UnwindSafe for BorrowError
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more