diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index cf43aecf7..d6061a7fc 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -1483,6 +1483,7 @@ impl Device { // `BTreeMap` has ordered bindings as keys, which allows us to coalesce // the descriptor writes into a single transaction. + let mut desc_set; // early declaration so it's dropped after write_map let mut write_map = BTreeMap::new(); let mut used_buffer_ranges = Vec::new(); for entry in desc.entries.iter() { @@ -1776,7 +1777,7 @@ impl Device { self.desc_allocator .lock() .allocate(&self.raw, &layout.raw, &layout.desc_count, 1)?; - let mut desc_set = desc_sets.pop().unwrap(); + desc_set = desc_sets.pop().unwrap(); // Set the descriptor set's label for easier debugging. if let Some(label) = desc.label.as_ref() {