on master help sign in
Upgrade bumpalo

No more BumpAllocSafe

commit58cec8e914a28d284130da519457d558bbb750c1 authorNick Fitzgerald <fitzgen@gmail.com> dateMon 11 Feb 2019, 18:25 (8 years ago) parent9fe3829
3 files changed+6−12
Cargo.toml+1−1 src/change_list.rs+1−3 src/node.rs+4−8
Cargo.toml+1−1
@@ -8,7 +8,7 @@ edition = "2018"
88default = []
99
1010[dependencies]
11−bumpalo = "1.0.2"
11+bumpalo = "2.0.0"
1212futures = "0.1"
1313wasm-bindgen = "0.2.33"
1414wasm-bindgen-futures = "0.3.10"
src/change_list.rs+1−3
@@ -1,5 +1,5 @@
11use crate::Listener;
2−use bumpalo::{Bump, BumpAllocSafe};
2+use bumpalo::Bump;
33use log::*;
44use std::fmt;
55use std::sync::Once;
@@ -240,8 +240,6 @@ pub enum ChangeDiscriminant {
240240 RemoveEventListener = 13,
241241}
242242
243−impl BumpAllocSafe for ChangeDiscriminant {}
244−
245243// Allocation utilities to ensure that we only allocation sequences of `u32`s
246244// into the change list's bump arena without any padding. This helps maintain
247245// the invariants required for `Bump::each_allocated_chunk`'s safety.
src/node.rs+4−8
@@ -1,5 +1,5 @@
11use crate::{RootRender, VdomWeak};
2−use bumpalo::{Bump, BumpAllocSafe};
2+use bumpalo::Bump;
33use std::fmt;
44use std::mem;
55
@@ -54,10 +54,6 @@ pub struct Attribute<'a> {
5454 pub value: &'a str,
5555}
5656
57−impl<'a> BumpAllocSafe for Node<'a> {}
58−impl<'a> BumpAllocSafe for Listener<'a> {}
59−impl<'a> BumpAllocSafe for Attribute<'a> {}
60−
6157impl fmt::Debug for Listener<'_> {
6258 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6359 let (a, b) = self.get_callback_parts();
@@ -81,9 +77,9 @@ impl<'a> Node<'a> {
8177 children: Children,
8278 ) -> Node<'a>
8379 where
84− Listeners: 'a + BumpAllocSafe + AsRef<[Listener<'a>]>,
85− Attributes: 'a + BumpAllocSafe + AsRef<[Attribute<'a>]>,
86− Children: 'a + BumpAllocSafe + AsRef<[Node<'a>]>,
80+ Listeners: 'a + AsRef<[Listener<'a>]>,
81+ Attributes: 'a + AsRef<[Attribute<'a>]>,
82+ Children: 'a + AsRef<[Node<'a>]>,
8783 {
8884 let children: &'a Children = bump.alloc(children);
8985 let children: &'a [Node<'a>] = children.as_ref();