diff --git a/Cargo.lock b/Cargo.lock index 2d1b8b5c640..6fca090dc22 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -147,6 +147,9 @@ name = "arrayvec" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd" +dependencies = [ + "serde", +] [[package]] name = "ash" @@ -5130,7 +5133,7 @@ version = "0.0.1" dependencies = [ "accountable-refcell", "app_units", - "arrayvec 0.5.1", + "arrayvec 0.7.1", "backtrace", "base64 0.10.1", "bitflags", @@ -6052,7 +6055,7 @@ name = "style" version = "0.0.1" dependencies = [ "app_units", - "arrayvec 0.5.1", + "arrayvec 0.7.1", "atomic_refcell", "bindgen", "bitflags", @@ -7060,7 +7063,7 @@ dependencies = [ name = "webgpu" version = "0.0.1" dependencies = [ - "arrayvec 0.5.1", + "arrayvec 0.7.1", "euclid", "ipc-channel", "log", diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index cfe9530e072..138627ae2cf 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -32,7 +32,7 @@ serde_json = "1.0" [dependencies] accountable-refcell = { version = "0.2.0", optional = true } app_units = "0.7" -arrayvec = "0.5.1" +arrayvec = "0.7" backtrace = "0.3" base64 = "0.10.1" bitflags = "1.0" diff --git a/components/script/dom/gpucanvascontext.rs b/components/script/dom/gpucanvascontext.rs index c0391d7ca61..6cb5592a9fc 100644 --- a/components/script/dom/gpucanvascontext.rs +++ b/components/script/dom/gpucanvascontext.rs @@ -135,7 +135,7 @@ impl GPUCanvasContextMethods for GPUCanvasContext { } *self.swap_chain.borrow_mut() = None; - let mut buffer_ids = ArrayVec::<[id::BufferId; PRESENTATION_BUFFER_COUNT]>::new(); + let mut buffer_ids = ArrayVec::::new(); for _ in 0..PRESENTATION_BUFFER_COUNT { buffer_ids.push( self.global() diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index 218229774b6..6fa7a503cdf 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -31,7 +31,7 @@ gecko_profiler = [] [dependencies] app_units = "0.7" -arrayvec = "0.5" +arrayvec = "0.7" atomic_refcell = "0.1" bitflags = "1.0" byteorder = "1.0" diff --git a/components/style/parallel.rs b/components/style/parallel.rs index 9e578e9e9e6..44618ef2fc1 100644 --- a/components/style/parallel.rs +++ b/components/style/parallel.rs @@ -69,7 +69,7 @@ pub const WORK_UNIT_MAX: usize = 16; /// A set of nodes, sized to the work unit. This gets copied when sent to other /// threads, so we keep it compact. -type WorkUnit = ArrayVec<[SendNode; WORK_UNIT_MAX]>; +type WorkUnit = ArrayVec, WORK_UNIT_MAX>; /// A callback to create our thread local context. This needs to be /// out of line so we don't allocate stack space for the entire struct diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index d2e503df3fb..f24d9b91f39 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -2534,11 +2534,8 @@ impl PropertyDeclaration { } } -type SubpropertiesArray = - [T; ${max(len(s.sub_properties) for s in data.shorthands_except_all()) \ - if data.shorthands_except_all() else 0}]; - -type SubpropertiesVec = ArrayVec>; +type SubpropertiesVec = ArrayVec; /// A stack-allocated vector of `PropertyDeclaration` /// large enough to parse one CSS `key: value` declaration. @@ -2594,7 +2591,8 @@ impl SourcePropertyDeclaration { /// Return type of SourcePropertyDeclaration::drain pub struct SourcePropertyDeclarationDrain<'a> { - declarations: ArrayVecDrain<'a, SubpropertiesArray>, + declarations: ArrayVecDrain<'a, PropertyDeclaration, ${max(len(s.sub_properties) for s in data.shorthands_except_all()) \ + if data.shorthands_except_all() else 0}>, all_shorthand: AllShorthand, } diff --git a/components/webgpu/Cargo.toml b/components/webgpu/Cargo.toml index 83ad50e2287..996c1df2b11 100644 --- a/components/webgpu/Cargo.toml +++ b/components/webgpu/Cargo.toml @@ -11,7 +11,7 @@ name = "webgpu" path = "lib.rs" [dependencies] -arrayvec = { version = "0.5.1", features = ["serde"] } +arrayvec = { version = "0.7", features = ["serde"] } euclid = "0.20" ipc-channel = "0.14" log = "0.4" diff --git a/components/webgpu/lib.rs b/components/webgpu/lib.rs index 24919041c8c..1103920cb8f 100644 --- a/components/webgpu/lib.rs +++ b/components/webgpu/lib.rs @@ -164,7 +164,7 @@ pub enum WebGPURequest { }, CreateSwapChain { device_id: id::DeviceId, - buffer_ids: ArrayVec<[id::BufferId; PRESENTATION_BUFFER_COUNT]>, + buffer_ids: ArrayVec, external_id: u64, sender: IpcSender, image_desc: webrender_api::ImageDescriptor, @@ -755,10 +755,10 @@ impl<'a> WGPU<'a> { size: Size2D::new(width, height), unassigned_buffer_ids: buffer_ids, available_buffer_ids: ArrayVec::< - [id::BufferId; PRESENTATION_BUFFER_COUNT], + id::BufferId, PRESENTATION_BUFFER_COUNT, >::new(), queued_buffer_ids: ArrayVec::< - [id::BufferId; PRESENTATION_BUFFER_COUNT], + id::BufferId, PRESENTATION_BUFFER_COUNT, >::new(), buffer_stride, image_key, @@ -1366,9 +1366,9 @@ pub struct PresentationData { queue_id: id::QueueId, pub data: Vec, pub size: Size2D, - unassigned_buffer_ids: ArrayVec<[id::BufferId; PRESENTATION_BUFFER_COUNT]>, - available_buffer_ids: ArrayVec<[id::BufferId; PRESENTATION_BUFFER_COUNT]>, - queued_buffer_ids: ArrayVec<[id::BufferId; PRESENTATION_BUFFER_COUNT]>, + unassigned_buffer_ids: ArrayVec, + available_buffer_ids: ArrayVec, + queued_buffer_ids: ArrayVec, buffer_stride: u32, image_key: webrender_api::ImageKey, image_desc: webrender_api::ImageDescriptor,