Function autoken::borrow_immutably
source · pub const fn borrow_immutably<T: ?Sized>()
Expand description
Virtually acquires an immutable reference to a global token of type T
.
This method is more typically called through the ImmutableBorrow
guard’s constructor.
In regular builds, this does nothing, but when AuToken checks a given binary, it uses calls to functions like this to determine whether a program has the possibility of virtually borrowing a global token in a way which violates XOR borrowing rules.
Global token identity is lifetime-erased (i.e. &'a u32
and &'b u32
always refer to the same
virtual global token). When T
is Nothing
, nothing happens.