pub enum BorrowErrorCode {
B0001,
B0002,
B0003,
B0004,
B0005,
B0006,
B0007,
B0012,
B0013,
B0014,
}Expand description
Stable, user-facing borrow error codes.
These provide a documented mapping from internal BorrowErrorKind variants
to the [B00XX] codes shown in compiler and LSP diagnostics. Both the
lexical borrow checker (borrow_checker.rs) and the MIR-based checker use
the same code space so users see consistent identifiers regardless of which
analysis detected the problem.
Variants§
B0001
Borrow conflict (aliasing violation): shared+exclusive or exclusive+exclusive.
B0002
Write to the owner while a borrow is active.
B0003
Reference escapes its scope (return, store in collection, closure capture).
B0004
Reference stored in a collection (array, object, enum).
B0005
Use after move.
B0006
Exclusive reference sent across a task/async boundary.
B0007
Inconsistent return-reference summary across branches.
B0012
Shared reference sent across a detached task boundary.
B0013
Call-site alias conflict: same variable passed to conflicting parameters.
B0014
Non-sendable value across detached task boundary.
Implementations§
Trait Implementations§
Source§impl Clone for BorrowErrorCode
impl Clone for BorrowErrorCode
Source§fn clone(&self) -> BorrowErrorCode
fn clone(&self) -> BorrowErrorCode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BorrowErrorCode
impl Debug for BorrowErrorCode
Source§impl Display for BorrowErrorCode
impl Display for BorrowErrorCode
Source§impl Hash for BorrowErrorCode
impl Hash for BorrowErrorCode
Source§impl PartialEq for BorrowErrorCode
impl PartialEq for BorrowErrorCode
impl Copy for BorrowErrorCode
impl Eq for BorrowErrorCode
impl StructuralPartialEq for BorrowErrorCode
Auto Trait Implementations§
impl Freeze for BorrowErrorCode
impl RefUnwindSafe for BorrowErrorCode
impl Send for BorrowErrorCode
impl Sync for BorrowErrorCode
impl Unpin for BorrowErrorCode
impl UnsafeUnpin for BorrowErrorCode
impl UnwindSafe for BorrowErrorCode
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.