pub struct MutableBorrowParams {
pub mutable_borrow: HashMap<Symbol, HashSet<Symbol>>,
}Expand description
Mutable borrow parameter analysis result.
Identifies Seq<T> parameters that are only mutated via element access
(SetIndex) but never structurally modified (no Push, Pop, Add, Remove,
or reassignment). These parameters can be passed as &mut [T] instead
of by value, eliminating the move-in/move-out ownership pattern.
Additional requirement: the function must return the parameter as its sole return value, so the call site can drop the assignment.
Fields§
§mutable_borrow: HashMap<Symbol, HashSet<Symbol>>fn_sym → set of param symbols eligible for &mut [T] borrow.
Implementations§
Auto Trait Implementations§
impl Freeze for MutableBorrowParams
impl RefUnwindSafe for MutableBorrowParams
impl Send for MutableBorrowParams
impl Sync for MutableBorrowParams
impl Unpin for MutableBorrowParams
impl UnsafeUnpin for MutableBorrowParams
impl UnwindSafe for MutableBorrowParams
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
Mutably borrows from an owned value. Read more