struct UpgradeState<'a> {
padding: Padding,
module: &'a mut Module,
upgraded_types: FastHashMap<Handle<Type>, Handle<Type>>,
}
Fields§
§padding: Padding
§module: &'a mut Module
§upgraded_types: FastHashMap<Handle<Type>, Handle<Type>>
A map from old types to their upgraded versions.
This ensures we never try to rebuild a type more than once.
Implementations§
source§impl UpgradeState<'_>
impl UpgradeState<'_>
fn inc_padding(&self) -> Padding
sourcefn upgrade_type(
&mut self,
ty: Handle<Type>,
upgrades: &Upgrades,
) -> Result<Handle<Type>, Error>
fn upgrade_type( &mut self, ty: Handle<Type>, upgrades: &Upgrades, ) -> Result<Handle<Type>, Error>
Get a type equivalent to ty
, but with Scalar
leaves upgraded to Atomic
scalars.
If such a type already exists in self.module.types
, return its handle.
Otherwise, construct a new one and return that handle.
If ty
is a Pointer
, Array
, BindingArray
, recurse into the
type and upgrade its leaf types.
If ty
is a Struct
, recurse into it and upgrade only those fields
whose indices appear in field_indices
.
The existing type is not affected.
fn upgrade_all(&mut self, upgrades: &Upgrades) -> Result<(), Error>
Auto Trait Implementations§
impl<'a> Freeze for UpgradeState<'a>
impl<'a> RefUnwindSafe for UpgradeState<'a>
impl<'a> Send for UpgradeState<'a>
impl<'a> Sync for UpgradeState<'a>
impl<'a> Unpin for UpgradeState<'a>
impl<'a> !UnwindSafe for UpgradeState<'a>
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