pub enum ReturnOwnershipMode {
NewlyOwned,
BorrowedFromParam(usize),
Shared,
Static,
Unknown,
}Expand description
Ownership classification of a function’s return value.
Used for interprocedural ownership inference (Phase 5.A). Each function’s return is classified into one of these modes so that callers can propagate the right storage decisions without emitting redundant Arc→Box promotions.
Unknown is the conservative fallback — it preserves current Arc-everywhere
behavior, so any inference uncertainty stays semantics-preserving.
Variants§
NewlyOwned
Returns a newly-allocated owned value. Caller can take ownership directly
(as Box) without an Arc round-trip.
Example: fn make() -> Array<int> { [1,2,3] }
BorrowedFromParam(usize)
Returns a reference/alias derived from the given parameter. Caller keeps
ownership of the source.
Example: fn first(arr: &Array<int>) -> &int { &arr[0] }
Returns a shared (Arc) value — reference-counted across callers.
Static
Returns a value proven to escape into global / static storage.
Unknown
Could not infer — fall back to current Arc behavior.
Implementations§
Trait Implementations§
Source§impl Clone for ReturnOwnershipMode
impl Clone for ReturnOwnershipMode
impl Copy for ReturnOwnershipMode
Source§impl Debug for ReturnOwnershipMode
impl Debug for ReturnOwnershipMode
Source§impl Default for ReturnOwnershipMode
impl Default for ReturnOwnershipMode
Source§impl<'de> Deserialize<'de> for ReturnOwnershipMode
impl<'de> Deserialize<'de> for ReturnOwnershipMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ReturnOwnershipMode
Source§impl Hash for ReturnOwnershipMode
impl Hash for ReturnOwnershipMode
Source§impl PartialEq for ReturnOwnershipMode
impl PartialEq for ReturnOwnershipMode
Source§impl Serialize for ReturnOwnershipMode
impl Serialize for ReturnOwnershipMode
impl StructuralPartialEq for ReturnOwnershipMode
Auto Trait Implementations§
impl Freeze for ReturnOwnershipMode
impl RefUnwindSafe for ReturnOwnershipMode
impl Send for ReturnOwnershipMode
impl Sync for ReturnOwnershipMode
impl Unpin for ReturnOwnershipMode
impl UnsafeUnpin for ReturnOwnershipMode
impl UnwindSafe for ReturnOwnershipMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more