diff --git a/naga/src/front/atomic_upgrade.rs b/naga/src/front/atomic_upgrade.rs index 29cb56b7868..f240e24ea62 100644 --- a/naga/src/front/atomic_upgrade.rs +++ b/naga/src/front/atomic_upgrade.rs @@ -30,10 +30,7 @@ //! [`Struct`]: TypeInner::Struct //! [`Load`]: crate::Expression::Load //! [`Store`]: crate::Statement::Store -use std::{ - collections::VecDeque, - sync::{atomic::AtomicUsize, Arc}, -}; +use std::sync::{atomic::AtomicUsize, Arc}; use crate::{GlobalVariable, Handle, Module, Type, TypeInner}; @@ -90,7 +87,7 @@ impl Padding { #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Hash)] pub struct ContainedGlobalVariable { - pub field_indices: VecDeque, + pub field_indices: Vec, pub handle: Handle, } @@ -109,7 +106,7 @@ impl UpgradeState<'_> { fn upgrade_type( &mut self, ty: Handle, - field_indices: &mut VecDeque, + field_indices: &mut Vec, ) -> Result, Error> { let padding = self.inc_padding(); padding.trace("visiting type: ", ty); @@ -129,10 +126,7 @@ impl UpgradeState<'_> { stride, }, TypeInner::Struct { ref members, span } => { - let index = field_indices - .pop_back() - .ok_or(Error::UnexpectedEndOfIndices)?; - + let index = field_indices.pop().ok_or(Error::UnexpectedEndOfIndices)?; let mut new_members = vec![]; for (i, mut member) in members.clone().into_iter().enumerate() { if i == index as usize { diff --git a/naga/src/front/spv/mod.rs b/naga/src/front/spv/mod.rs index 6c3a3595542..25010912ebb 100644 --- a/naga/src/front/spv/mod.rs +++ b/naga/src/front/spv/mod.rs @@ -45,7 +45,7 @@ use crate::{ }; use petgraph::graphmap::GraphMap; -use std::{collections::VecDeque, convert::TryInto, mem, num::NonZeroU32, path::PathBuf}; +use std::{convert::TryInto, mem, num::NonZeroU32, path::PathBuf}; use super::atomic_upgrade::ContainedGlobalVariable; @@ -573,7 +573,7 @@ impl BlockContext<'_> { mut handle: Handle, ) -> Result { log::debug!("\t\tlocating global variable in {handle:?}"); - let mut accesses = VecDeque::default(); + let mut accesses = vec![]; loop { match self.expressions[handle] { crate::Expression::Access { base, index } => { @@ -582,7 +582,7 @@ impl BlockContext<'_> { } crate::Expression::AccessIndex { base, index } => { handle = base; - accesses.push_back(index); + accesses.push(index); log::debug!("\t\t access index {handle:?} {index:?}"); } crate::Expression::GlobalVariable(h) => {