mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Stop requiring that the type argument to RootedVec implements Reflectable.
It is sufficient that it implements JSTraceable.
This commit is contained in:
parent
b05f4aa3aa
commit
ca5e7097a0
1 changed files with 6 additions and 8 deletions
|
@ -455,19 +455,17 @@ impl<'a, T: JSTraceable> Drop for RootedTraceable<'a, T> {
|
|||
}
|
||||
}
|
||||
|
||||
/// A vector of items that are rooted for the lifetime
|
||||
/// of this struct.
|
||||
/// Must be a reflectable
|
||||
/// A vector of items that are rooted for the lifetime of this struct.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[no_move]
|
||||
#[derive(JSTraceable)]
|
||||
#[allow_unrooted_interior]
|
||||
pub struct RootedVec<T: JSTraceable + Reflectable> {
|
||||
pub struct RootedVec<T: JSTraceable> {
|
||||
v: Vec<T>
|
||||
}
|
||||
|
||||
|
||||
impl<T: JSTraceable + Reflectable> RootedVec<T> {
|
||||
impl<T: JSTraceable> RootedVec<T> {
|
||||
/// Create a vector of items of type T that is rooted for
|
||||
/// the lifetime of this struct
|
||||
pub fn new() -> RootedVec<T> {
|
||||
|
@ -495,20 +493,20 @@ impl<T: JSTraceable + Reflectable> RootedVec<JS<T>> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: JSTraceable + Reflectable> Drop for RootedVec<T> {
|
||||
impl<T: JSTraceable> Drop for RootedVec<T> {
|
||||
fn drop(&mut self) {
|
||||
RootedTraceableSet::remove(self);
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: JSTraceable + Reflectable> Deref for RootedVec<T> {
|
||||
impl<T: JSTraceable> Deref for RootedVec<T> {
|
||||
type Target = Vec<T>;
|
||||
fn deref(&self) -> &Vec<T> {
|
||||
&self.v
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: JSTraceable + Reflectable> DerefMut for RootedVec<T> {
|
||||
impl<T: JSTraceable> DerefMut for RootedVec<T> {
|
||||
fn deref_mut(&mut self) -> &mut Vec<T> {
|
||||
&mut self.v
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue