Skip to content

Commit 080fb76

Browse files
Remove dependency on rustc_plugin from servo
1 parent b0f93b9 commit 080fb76

35 files changed

+5
-74
lines changed

collector/benchmarks/script-servo/components/dom_struct/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub fn dom_struct(args: TokenStream, input: TokenStream) -> TokenStream {
1616
}
1717
let attributes = quote! {
1818
#[derive(DenyPublicFields, DomObject, JSTraceable, MallocSizeOf)]
19-
#[must_root]
2019
#[repr(C)]
2120
};
2221
let attributes = attributes.to_string().parse().unwrap();

collector/benchmarks/script-servo/components/script/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ path = "lib.rs"
1414
[features]
1515
debugmozjs = ['js/debugmozjs']
1616
unstable = ["servo_allocator/unstable"]
17-
unrooted_must_root_lint = ["script_plugins/unrooted_must_root_lint"]
18-
default = ["unrooted_must_root_lint"]
17+
default = []
1918

2019
[build-dependencies]
2120
cmake = "0.1"
@@ -75,7 +74,6 @@ ref_filter_map = "1.0.1"
7574
ref_slice = "1.0"
7675
regex = "0.2"
7776
script_layout_interface = {path = "../script_layout_interface"}
78-
script_plugins = {path = "../script_plugins"}
7977
script_traits = {path = "../script_traits"}
8078
selectors = { path = "../selectors" }
8179
serde = "1.0"

collector/benchmarks/script-servo/components/script/document_loader.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ impl LoadType {
4242
/// created via DocumentLoader::fetch_async) are always removed by the time
4343
/// that the owner is destroyed.
4444
#[derive(JSTraceable, MallocSizeOf)]
45-
#[must_root]
4645
pub struct LoadBlocker {
4746
/// The document whose load event is blocked by this object existing.
4847
doc: Dom<Document>,

collector/benchmarks/script-servo/components/script/dom/bindings/callback.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ pub enum ExceptionHandling {
3636
/// A common base class for representing IDL callback function and
3737
/// callback interface types.
3838
#[derive(JSTraceable)]
39-
#[must_root]
4039
pub struct CallbackObject {
4140
/// The underlying `JSObject`.
4241
callback: Heap<*mut JSObject>,
@@ -127,7 +126,6 @@ pub trait CallbackContainer {
127126

128127
/// A common base class for representing IDL callback function types.
129128
#[derive(JSTraceable, PartialEq)]
130-
#[must_root]
131129
pub struct CallbackFunction {
132130
object: CallbackObject,
133131
}
@@ -158,7 +156,6 @@ impl CallbackFunction {
158156

159157
/// A common base class for representing IDL callback interface types.
160158
#[derive(JSTraceable, PartialEq)]
161-
#[must_root]
162159
pub struct CallbackInterface {
163160
object: CallbackObject,
164161
}

collector/benchmarks/script-servo/components/script/dom/bindings/codegen/CodegenRust.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6070,7 +6070,7 @@ def struct(self):
60706070
derive = ["JSTraceable"]
60716071
mustRoot = ""
60726072
if self.membersNeedTracing():
6073-
mustRoot = "#[must_root]\n"
6073+
mustRoot = ""
60746074
derive += ["Default"]
60756075

60766076
return (string.Template(
@@ -6522,7 +6522,7 @@ def __init__(self, idlObject, descriptorProvider, baseName, methods,
65226522
bases=[ClassBase(baseName)],
65236523
constructors=self.getConstructors(),
65246524
methods=realMethods + getters + setters,
6525-
decorators="#[derive(JSTraceable, PartialEq)]\n#[allow_unrooted_interior]")
6525+
decorators="#[derive(JSTraceable, PartialEq)]")
65266526

65276527
def getConstructors(self):
65286528
return [ClassConstructor(

collector/benchmarks/script-servo/components/script/dom/bindings/refcounted.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ impl TrustedPromise {
145145
/// shared among threads for use in asynchronous operations. The underlying
146146
/// DOM object is guaranteed to live at least as long as the last outstanding
147147
/// `Trusted<T>` instance.
148-
#[allow_unrooted_interior]
149148
pub struct Trusted<T: DomObject> {
150149
/// A pointer to the Rust DOM object of type T, but void to allow
151150
/// sending `Trusted<T>` between threads, regardless of T's sendability.

collector/benchmarks/script-servo/components/script/dom/bindings/reflector.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ pub fn reflect_dom_object<T, U>(
2828
/// A struct to store a reference to the reflector of a DOM object.
2929
#[allow(unrooted_must_root)]
3030
#[derive(MallocSizeOf)]
31-
#[must_root]
3231
// If you're renaming or moving this field, update the path in plugins::reflector as well
3332
pub struct Reflector {
3433
#[ignore_malloc_size_of = "defined and measured in rust-mozjs"]

collector/benchmarks/script-servo/components/script/dom/bindings/root.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ use style::thread_state;
4848

4949
/// A rooted value.
5050
#[allow(unrooted_must_root)]
51-
#[allow_unrooted_interior]
5251
pub struct Root<T: StableTraceObject> {
5352
/// The value to root.
5453
value: T,
@@ -310,7 +309,6 @@ impl<'root, T: RootedReference<'root> + 'root> RootedReference<'root> for Option
310309
/// on the stack, the `Dom<T>` can point to freed memory.
311310
///
312311
/// This should only be used as a field in other DOM objects.
313-
#[must_root]
314312
pub struct Dom<T> {
315313
ptr: NonZero<*const T>,
316314
}
@@ -372,7 +370,6 @@ unsafe impl<T: DomObject> JSTraceable for Dom<T> {
372370

373371
/// An unrooted reference to a DOM object for use in layout. `Layout*Helpers`
374372
/// traits must be implemented on this.
375-
#[allow_unrooted_interior]
376373
pub struct LayoutDom<T> {
377374
ptr: NonZero<*const T>,
378375
}
@@ -484,7 +481,6 @@ impl LayoutDom<Node> {
484481
///
485482
/// This should only be used as a field in other DOM objects; see warning
486483
/// on `Dom<T>`.
487-
#[must_root]
488484
#[derive(JSTraceable)]
489485
pub struct MutDom<T: DomObject> {
490486
val: UnsafeCell<Dom<T>>,
@@ -545,7 +541,6 @@ impl<T: DomObject + PartialEq> PartialEq<T> for MutDom<T> {
545541
///
546542
/// This should only be used as a field in other DOM objects; see warning
547543
/// on `Dom<T>`.
548-
#[must_root]
549544
#[derive(JSTraceable)]
550545
pub struct MutNullableDom<T: DomObject> {
551546
ptr: UnsafeCell<Option<Dom<T>>>,
@@ -648,7 +643,6 @@ impl<T: DomObject> MallocSizeOf for MutNullableDom<T> {
648643
///
649644
/// This should only be used as a field in other DOM objects; see warning
650645
/// on `Dom<T>`.
651-
#[must_root]
652646
pub struct DomOnceCell<T: DomObject> {
653647
ptr: OnceCell<Dom<T>>,
654648
}

collector/benchmarks/script-servo/components/script/dom/bindings/trace.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,6 @@ impl<'a, T: JSTraceable + 'static> Drop for RootedTraceable<'a, T> {
750750
/// If you have GC things like *mut JSObject or JSVal, use rooted!.
751751
/// If you have an arbitrary number of DomObjects to root, use rooted_vec!.
752752
/// If you know what you're doing, use this.
753-
#[allow_unrooted_interior]
754753
pub struct RootedTraceableBox<T: 'static + JSTraceable> {
755754
ptr: *mut T,
756755
}
@@ -812,7 +811,6 @@ impl<T: JSTraceable + 'static> Drop for RootedTraceableBox<T> {
812811
/// iterator of `DomRoot`s, `rooted_vec!(let v <- iterator);`.
813812
#[allow(unrooted_must_root)]
814813
#[derive(JSTraceable)]
815-
#[allow_unrooted_interior]
816814
pub struct RootableVec<T: JSTraceable> {
817815
v: Vec<T>,
818816
}
@@ -827,7 +825,6 @@ impl<T: JSTraceable> RootableVec<T> {
827825
}
828826

829827
/// A vector of items that are rooted for the lifetime 'a.
830-
#[allow_unrooted_interior]
831828
pub struct RootedVec<'a, T: 'static + JSTraceable> {
832829
root: &'a mut RootableVec<T>,
833830
}

collector/benchmarks/script-servo/components/script/dom/bindings/weakref.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ use std::ops::{Deref, DerefMut, Drop};
3030
pub const DOM_WEAK_SLOT: u32 = 1;
3131

3232
/// A weak reference to a JS-managed DOM object.
33-
#[allow_unrooted_interior]
3433
pub struct WeakRef<T: WeakReferenceable> {
3534
ptr: NonZero<*mut WeakBox<T>>,
3635
}
3736

3837
/// The inner box of weak references, public for the finalization in codegen.
39-
#[must_root]
4038
pub struct WeakBox<T: WeakReferenceable> {
4139
/// The reference count. When it reaches zero, the `value` field should
4240
/// have already been set to `None`. The pointee contributes one to the count.
@@ -209,7 +207,6 @@ unsafe impl<T: WeakReferenceable> JSTraceable for MutableWeakRef<T> {
209207

210208
/// A vector of weak references. On tracing, the vector retains
211209
/// only references which still point to live objects.
212-
#[allow_unrooted_interior]
213210
#[derive(MallocSizeOf)]
214211
pub struct WeakRefVec<T: WeakReferenceable> {
215212
vec: Vec<WeakRef<T>>,
@@ -256,7 +253,6 @@ impl<T: WeakReferenceable> DerefMut for WeakRefVec<T> {
256253

257254
/// An entry of a vector of weak references. Passed to the closure
258255
/// given to `WeakRefVec::update`.
259-
#[allow_unrooted_interior]
260256
pub struct WeakRefEntry<'a, T: WeakReferenceable + 'a> {
261257
vec: &'a mut WeakRefVec<T>,
262258
index: &'a mut usize,

0 commit comments

Comments
 (0)