Skip to main content

assert_or_select

Function assert_or_select 

Source
#[doc(hidden)]
pub unsafe fn assert_or_select<const N: usize>( args: [(SEXP, &str); N], borrows: [Option<NativeBorrow>; N], ) -> [bool; N]
Expand description

The first pass of a generated wrapper’s alias check (#1504).

Checks borrows as assert_no_aliases does, taking both arms of every Either. A conflict that involves an argument whose top level is an Either (NativeBorrow::selects) may vanish once that argument’s arm is known, so it raises nothing and marks the argument instead. Returns the marked arguments: the wrapper prepares them, replaces their metadata with what the prepared conversion borrows, and calls assert_no_aliases, which then reports every conflict that remains. With nothing marked, every conflict found has already been raised.

§Safety

As for assert_no_aliases.