aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorSamson <16504129+sagudev@users.noreply.github.com>2023-12-01 16:50:52 +0100
committerGitHub <noreply@github.com>2023-12-01 15:50:52 +0000
commit604979e367faa6aa09805e8fa0223b8883ea009d (patch)
treeb61c5ffefbd4c43aa3e81bd89b70dad41d7c2626 /components
parent20a73721de2f1a8a0b29905617783148bd3cfaff (diff)
downloadservo-604979e367faa6aa09805e8fa0223b8883ea009d.tar.gz
servo-604979e367faa6aa09805e8fa0223b8883ea009d.zip
Replace script_plugins with a clippy like rustc driver (named crown) (#30508)
* Remove script_plugins * Use crown instead of script_plugins * crown_is_not_used * Use crown in command base * bootstrap crown * tidy happy * disable sccache * Bring crown in tree * Install crown from tree * fix windows ci * fix warning * fix mac libscript_plugins.dylib is not available anymore * Update components/script/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> * Update for nightly-2023-03-18 Mostly just based off https://github.com/servo/servo/pull/30630 * Always install crown it's slow only when there is new version * Run crown test with `mach test-unit` * Small fixups; better trace_in_no_trace tests * Better doc * crown in config.toml * Fix tidy for real * no sccache on rustc_wrapper * document rustc overrides * fixup of compiletest * Make a few minor comment adjustments * Fix a typo in python/servo/platform/base.py Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com> * Proper test types * Ignore tidy on crown/tests --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components')
-rw-r--r--components/dom_struct/lib.rs2
-rw-r--r--components/script/Cargo.toml4
-rw-r--r--components/script/animations.rs2
-rw-r--r--components/script/body.rs4
-rw-r--r--components/script/canvas_state.rs8
-rw-r--r--components/script/docs/JS-Servos-only-GC.md2
-rw-r--r--components/script/document_loader.rs2
-rw-r--r--components/script/dom/analysernode.rs4
-rw-r--r--components/script/dom/audiobuffer.rs4
-rw-r--r--components/script/dom/audiobuffersourcenode.rs4
-rw-r--r--components/script/dom/audiocontext.rs4
-rw-r--r--components/script/dom/audiodestinationnode.rs2
-rw-r--r--components/script/dom/audiolistener.rs2
-rw-r--r--components/script/dom/audioparam.rs2
-rw-r--r--components/script/dom/audioscheduledsourcenode.rs2
-rw-r--r--components/script/dom/baseaudiocontext.rs6
-rw-r--r--components/script/dom/bindings/callback.rs14
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py4
-rw-r--r--components/script/dom/bindings/mod.rs2
-rw-r--r--components/script/dom/bindings/refcounted.rs14
-rw-r--r--components/script/dom/bindings/reflector.rs6
-rw-r--r--components/script/dom/bindings/root.rs40
-rw-r--r--components/script/dom/bindings/settings_stack.rs2
-rw-r--r--components/script/dom/bindings/trace.rs14
-rw-r--r--components/script/dom/bindings/weakref.rs10
-rw-r--r--components/script/dom/biquadfilternode.rs4
-rw-r--r--components/script/dom/blob.rs2
-rw-r--r--components/script/dom/bluetooth.rs4
-rw-r--r--components/script/dom/bluetoothdevice.rs4
-rw-r--r--components/script/dom/bluetoothpermissionresult.rs4
-rw-r--r--components/script/dom/canvasrenderingcontext2d.rs2
-rw-r--r--components/script/dom/channelmergernode.rs4
-rw-r--r--components/script/dom/channelsplitternode.rs4
-rw-r--r--components/script/dom/constantsourcenode.rs4
-rw-r--r--components/script/dom/cssfontfacerule.rs2
-rw-r--r--components/script/dom/cssimportrule.rs2
-rw-r--r--components/script/dom/csskeyframerule.rs2
-rw-r--r--components/script/dom/csskeyframesrule.rs2
-rw-r--r--components/script/dom/cssmediarule.rs2
-rw-r--r--components/script/dom/cssnamespacerule.rs2
-rw-r--r--components/script/dom/cssrule.rs2
-rw-r--r--components/script/dom/cssrulelist.rs4
-rw-r--r--components/script/dom/cssstyledeclaration.rs6
-rw-r--r--components/script/dom/cssstylerule.rs2
-rw-r--r--components/script/dom/cssstylesheet.rs2
-rw-r--r--components/script/dom/csssupportsrule.rs2
-rw-r--r--components/script/dom/customelementregistry.rs8
-rw-r--r--components/script/dom/dissimilaroriginlocation.rs2
-rw-r--r--components/script/dom/document.rs14
-rw-r--r--components/script/dom/documentorshadowroot.rs8
-rw-r--r--components/script/dom/documenttype.rs2
-rw-r--r--components/script/dom/dommatrix.rs2
-rw-r--r--components/script/dom/dommatrixreadonly.rs2
-rw-r--r--components/script/dom/dynamicmoduleowner.rs4
-rw-r--r--components/script/dom/element.rs4
-rw-r--r--components/script/dom/file.rs4
-rw-r--r--components/script/dom/filelist.rs4
-rw-r--r--components/script/dom/formdata.rs4
-rw-r--r--components/script/dom/gainnode.rs4
-rw-r--r--components/script/dom/gamepadbuttonlist.rs2
-rw-r--r--components/script/dom/globalscope.rs6
-rw-r--r--components/script/dom/gpu.rs2
-rw-r--r--components/script/dom/gpusupportedfeatures.rs2
-rw-r--r--components/script/dom/htmlanchorelement.rs2
-rw-r--r--components/script/dom/htmlareaelement.rs2
-rw-r--r--components/script/dom/htmlaudioelement.rs2
-rw-r--r--components/script/dom/htmlbaseelement.rs2
-rw-r--r--components/script/dom/htmlbodyelement.rs2
-rw-r--r--components/script/dom/htmlbrelement.rs2
-rwxr-xr-xcomponents/script/dom/htmlbuttonelement.rs2
-rw-r--r--components/script/dom/htmlcanvaselement.rs4
-rw-r--r--components/script/dom/htmlcollection.rs4
-rw-r--r--components/script/dom/htmldataelement.rs2
-rw-r--r--components/script/dom/htmldatalistelement.rs2
-rw-r--r--components/script/dom/htmldetailselement.rs2
-rw-r--r--components/script/dom/htmldialogelement.rs2
-rw-r--r--components/script/dom/htmldirectoryelement.rs2
-rw-r--r--components/script/dom/htmldivelement.rs2
-rw-r--r--components/script/dom/htmldlistelement.rs2
-rw-r--r--components/script/dom/htmlelement.rs2
-rw-r--r--components/script/dom/htmlembedelement.rs2
-rw-r--r--components/script/dom/htmlfieldsetelement.rs2
-rw-r--r--components/script/dom/htmlfontelement.rs2
-rw-r--r--components/script/dom/htmlformelement.rs2
-rw-r--r--components/script/dom/htmlframeelement.rs2
-rw-r--r--components/script/dom/htmlframesetelement.rs2
-rw-r--r--components/script/dom/htmlheadelement.rs2
-rw-r--r--components/script/dom/htmlheadingelement.rs2
-rw-r--r--components/script/dom/htmlhrelement.rs2
-rw-r--r--components/script/dom/htmlhtmlelement.rs2
-rw-r--r--components/script/dom/htmliframeelement.rs2
-rw-r--r--components/script/dom/htmlimageelement.rs4
-rwxr-xr-xcomponents/script/dom/htmlinputelement.rs4
-rw-r--r--components/script/dom/htmllabelelement.rs2
-rw-r--r--components/script/dom/htmllegendelement.rs2
-rw-r--r--components/script/dom/htmllielement.rs2
-rw-r--r--components/script/dom/htmllinkelement.rs4
-rw-r--r--components/script/dom/htmlmapelement.rs2
-rw-r--r--components/script/dom/htmlmediaelement.rs8
-rw-r--r--components/script/dom/htmlmenuelement.rs2
-rw-r--r--components/script/dom/htmlmetaelement.rs2
-rw-r--r--components/script/dom/htmlmeterelement.rs2
-rw-r--r--components/script/dom/htmlmodelement.rs2
-rwxr-xr-xcomponents/script/dom/htmlobjectelement.rs2
-rw-r--r--components/script/dom/htmlolistelement.rs2
-rw-r--r--components/script/dom/htmloptgroupelement.rs2
-rw-r--r--components/script/dom/htmloptionelement.rs2
-rw-r--r--components/script/dom/htmloutputelement.rs2
-rw-r--r--components/script/dom/htmlparagraphelement.rs2
-rw-r--r--components/script/dom/htmlparamelement.rs2
-rw-r--r--components/script/dom/htmlpictureelement.rs2
-rw-r--r--components/script/dom/htmlpreelement.rs2
-rw-r--r--components/script/dom/htmlprogresselement.rs2
-rw-r--r--components/script/dom/htmlquoteelement.rs2
-rw-r--r--components/script/dom/htmlscriptelement.rs2
-rwxr-xr-xcomponents/script/dom/htmlselectelement.rs2
-rw-r--r--components/script/dom/htmlsourceelement.rs2
-rw-r--r--components/script/dom/htmlspanelement.rs2
-rw-r--r--components/script/dom/htmlstyleelement.rs4
-rw-r--r--components/script/dom/htmltablecaptionelement.rs2
-rw-r--r--components/script/dom/htmltablecellelement.rs2
-rw-r--r--components/script/dom/htmltablecolelement.rs2
-rw-r--r--components/script/dom/htmltableelement.rs4
-rw-r--r--components/script/dom/htmltablerowelement.rs2
-rw-r--r--components/script/dom/htmltablesectionelement.rs2
-rw-r--r--components/script/dom/htmltemplateelement.rs2
-rwxr-xr-xcomponents/script/dom/htmltextareaelement.rs4
-rw-r--r--components/script/dom/htmltimeelement.rs2
-rw-r--r--components/script/dom/htmltitleelement.rs2
-rw-r--r--components/script/dom/htmlulistelement.rs2
-rw-r--r--components/script/dom/htmlunknownelement.rs2
-rw-r--r--components/script/dom/htmlvideoelement.rs2
-rw-r--r--components/script/dom/macros.rs2
-rw-r--r--components/script/dom/mediaelementaudiosourcenode.rs4
-rw-r--r--components/script/dom/medialist.rs4
-rw-r--r--components/script/dom/mediasession.rs2
-rw-r--r--components/script/dom/mediastreamaudiodestinationnode.rs4
-rw-r--r--components/script/dom/mediastreamaudiosourcenode.rs4
-rw-r--r--components/script/dom/mediastreamtrackaudiosourcenode.rs4
-rw-r--r--components/script/dom/messageevent.rs4
-rw-r--r--components/script/dom/mutationrecord.rs2
-rw-r--r--components/script/dom/navigationpreloadmanager.rs2
-rw-r--r--components/script/dom/node.rs6
-rw-r--r--components/script/dom/nodelist.rs14
-rw-r--r--components/script/dom/offlineaudiocontext.rs4
-rw-r--r--components/script/dom/offscreencanvas.rs2
-rw-r--r--components/script/dom/offscreencanvasrenderingcontext2d.rs2
-rw-r--r--components/script/dom/oscillatornode.rs4
-rw-r--r--components/script/dom/paintworkletglobalscope.rs4
-rw-r--r--components/script/dom/pannernode.rs4
-rw-r--r--components/script/dom/performanceentry.rs2
-rw-r--r--components/script/dom/performanceobserver.rs2
-rw-r--r--components/script/dom/performanceobserverentrylist.rs2
-rw-r--r--components/script/dom/performancepainttiming.rs2
-rw-r--r--components/script/dom/performanceresourcetiming.rs2
-rw-r--r--components/script/dom/performancetiming.rs2
-rw-r--r--components/script/dom/promise.rs12
-rw-r--r--components/script/dom/promiserejectionevent.rs6
-rw-r--r--components/script/dom/radionodelist.rs4
-rw-r--r--components/script/dom/range.rs6
-rw-r--r--components/script/dom/raredata.rs4
-rw-r--r--components/script/dom/response.rs2
-rw-r--r--components/script/dom/rtcdatachannel.rs2
-rw-r--r--components/script/dom/rtctrackevent.rs2
-rw-r--r--components/script/dom/serviceworker.rs2
-rw-r--r--components/script/dom/serviceworkercontainer.rs2
-rw-r--r--components/script/dom/serviceworkerregistration.rs2
-rw-r--r--components/script/dom/servoparser/async_html.rs6
-rw-r--r--components/script/dom/servoparser/html.rs6
-rw-r--r--components/script/dom/servoparser/mod.rs12
-rw-r--r--components/script/dom/servoparser/prefetch.rs2
-rw-r--r--components/script/dom/servoparser/xml.rs6
-rw-r--r--components/script/dom/shadowroot.rs6
-rw-r--r--components/script/dom/stereopannernode.rs4
-rw-r--r--components/script/dom/stylesheet.rs2
-rw-r--r--components/script/dom/stylesheetlist.rs6
-rw-r--r--components/script/dom/svgsvgelement.rs2
-rw-r--r--components/script/dom/testbinding.rs8
-rw-r--r--components/script/dom/testbindingmaplike.rs2
-rw-r--r--components/script/dom/testbindingsetlike.rs2
-rw-r--r--components/script/dom/trackevent.rs4
-rw-r--r--components/script/dom/vertexarrayobject.rs6
-rw-r--r--components/script/dom/webgl2renderingcontext.rs4
-rw-r--r--components/script/dom/webgl_extensions/extensions.rs2
-rw-r--r--components/script/dom/webgl_extensions/wrapper.rs2
-rw-r--r--components/script/dom/webglframebuffer.rs2
-rw-r--r--components/script/dom/webglrenderingcontext.rs6
-rw-r--r--components/script/dom/webgltexture.rs2
-rw-r--r--components/script/dom/worker.rs2
-rw-r--r--components/script/dom/workerglobalscope.rs2
-rw-r--r--components/script/dom/worklet.rs4
-rw-r--r--components/script/dom/xrinputsourceevent.rs2
-rw-r--r--components/script/dom/xrinputsourceschangeevent.rs2
-rw-r--r--components/script/dom/xrsessionevent.rs2
-rw-r--r--components/script/fetch.rs4
-rw-r--r--components/script/lib.rs15
-rw-r--r--components/script/script_module.rs4
-rw-r--r--components/script/script_runtime.rs4
-rw-r--r--components/script/script_thread.rs8
-rw-r--r--components/script_plugins/Cargo.toml18
-rw-r--r--components/script_plugins/lib.rs349
-rw-r--r--components/script_plugins/trace_in_no_trace.rs202
-rw-r--r--components/script_plugins/unrooted_must_root.rs376
203 files changed, 357 insertions, 1313 deletions
diff --git a/components/dom_struct/lib.rs b/components/dom_struct/lib.rs
index d501a1a63a5..3cafbb48731 100644
--- a/components/dom_struct/lib.rs
+++ b/components/dom_struct/lib.rs
@@ -13,7 +13,7 @@ pub fn dom_struct(args: TokenStream, input: TokenStream) -> TokenStream {
}
let attributes = quote! {
#[derive(deny_public_fields::DenyPublicFields, domobject_derive::DomObject, JSTraceable, MallocSizeOf)]
- #[unrooted_must_root_lint::must_root]
+ #[crown::unrooted_must_root_lint::must_root]
#[repr(C)]
};
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml
index 41527bf18c6..a92489538ae 100644
--- a/components/script/Cargo.toml
+++ b/components/script/Cargo.toml
@@ -16,9 +16,6 @@ path = "lib.rs"
debugmozjs = ['js/debugmozjs']
jitspew = ['js/jitspew']
profilemozjs = ['js/profilemozjs']
-unrooted_must_root_lint = ["script_plugins/unrooted_must_root_lint"]
-trace_in_no_trace_lint = ["script_plugins/trace_in_no_trace_lint"]
-default = ["unrooted_must_root_lint", "trace_in_no_trace_lint"]
webgl_backtrace = ["canvas_traits/webgl_backtrace"]
js_backtrace = []
refcell_backtrace = ["accountable-refcell"]
@@ -88,7 +85,6 @@ range = { path = "../range" }
ref_filter_map = "1.0.1"
regex = { workspace = true }
script_layout_interface = { workspace = true }
-script_plugins = { path = "../script_plugins" }
script_traits = { workspace = true }
selectors = { path = "../selectors", features = ["shmem"] }
serde = { workspace = true, features = ["derive"] }
diff --git a/components/script/animations.rs b/components/script/animations.rs
index 674ec7afcaa..128df043cf3 100644
--- a/components/script/animations.rs
+++ b/components/script/animations.rs
@@ -36,7 +36,7 @@ use crate::dom::window::Window;
/// The set of animations for a document.
#[derive(Default, JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub(crate) struct Animations {
/// The map of nodes to their animation states.
#[no_trace]
diff --git a/components/script/body.rs b/components/script/body.rs
index 1e7475109bb..5dbfb706f7d 100644
--- a/components/script/body.rs
+++ b/components/script/body.rs
@@ -715,7 +715,7 @@ impl Callback for ConsumeBodyPromiseHandler {
}
// https://fetch.spec.whatwg.org/#concept-body-consume-body
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
pub fn consume_body<T: BodyMixin + DomObject>(object: &T, body_type: BodyType) -> Rc<Promise> {
let in_realm_proof = AlreadyInRealm::assert();
let promise = Promise::new_in_current_realm(InRealm::Already(&in_realm_proof));
@@ -739,7 +739,7 @@ pub fn consume_body<T: BodyMixin + DomObject>(object: &T, body_type: BodyType) -
}
// https://fetch.spec.whatwg.org/#concept-body-consume-body
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
fn consume_body_with_promise<T: BodyMixin + DomObject>(
object: &T,
body_type: BodyType,
diff --git a/components/script/canvas_state.rs b/components/script/canvas_state.rs
index be8a25f4383..d08f142ca10 100644
--- a/components/script/canvas_state.rs
+++ b/components/script/canvas_state.rs
@@ -57,7 +57,7 @@ use crate::dom::paintworkletglobalscope::PaintWorkletGlobalScope;
use crate::dom::textmetrics::TextMetrics;
use crate::unpremultiplytable::UNPREMULTIPLY_TABLE;
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(Clone, JSTraceable, MallocSizeOf)]
#[allow(dead_code)]
pub(crate) enum CanvasFillOrStrokeStyle {
@@ -76,7 +76,7 @@ impl CanvasFillOrStrokeStyle {
}
}
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(Clone, JSTraceable, MallocSizeOf)]
pub(crate) struct CanvasContextState {
global_alpha: f64,
@@ -136,7 +136,7 @@ impl CanvasContextState {
}
}
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(JSTraceable, MallocSizeOf)]
pub(crate) struct CanvasState {
#[ignore_malloc_size_of = "Defined in ipc-channel"]
@@ -927,7 +927,7 @@ impl CanvasState {
self.send_canvas_2d_msg(Canvas2dMsg::SaveContext);
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
// https://html.spec.whatwg.org/multipage/#dom-context-2d-restore
pub fn restore(&self) {
let mut saved_states = self.saved_states.borrow_mut();
diff --git a/components/script/docs/JS-Servos-only-GC.md b/components/script/docs/JS-Servos-only-GC.md
index d7611fc7336..95eb694bce6 100644
--- a/components/script/docs/JS-Servos-only-GC.md
+++ b/components/script/docs/JS-Servos-only-GC.md
@@ -172,7 +172,7 @@ is where we actually call the SpiderMonkey trace hooks:
```rust
/// Trace the `JSObject` held by `reflector`.
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
pub fn trace_reflector(tracer: *mut JSTracer, description: &str, reflector: &Reflector) {
trace!("tracing reflector {}", description);
trace_object(tracer, description, reflector.rootable())
diff --git a/components/script/document_loader.rs b/components/script/document_loader.rs
index 02a33a0ce74..3be77d7e31b 100644
--- a/components/script/document_loader.rs
+++ b/components/script/document_loader.rs
@@ -29,7 +29,7 @@ pub enum LoadType {
/// created via DocumentLoader::fetch_async) are always removed by the time
/// that the owner is destroyed.
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct LoadBlocker {
/// The document whose load event is blocked by this object existing.
doc: Dom<Document>,
diff --git a/components/script/dom/analysernode.rs b/components/script/dom/analysernode.rs
index 237a0e79fb6..71bf078202c 100644
--- a/components/script/dom/analysernode.rs
+++ b/components/script/dom/analysernode.rs
@@ -37,7 +37,7 @@ pub struct AnalyserNode {
}
impl AnalyserNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
_: &Window,
context: &BaseAudioContext,
@@ -99,7 +99,7 @@ impl AnalyserNode {
Self::new_with_proto(window, None, context, options)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/audiobuffer.rs b/components/script/dom/audiobuffer.rs
index 81943ca25f5..5645d418ee5 100644
--- a/components/script/dom/audiobuffer.rs
+++ b/components/script/dom/audiobuffer.rs
@@ -63,7 +63,7 @@ pub struct AudioBuffer {
}
impl AudioBuffer {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
#[allow(unsafe_code)]
pub fn new_inherited(number_of_channels: u32, length: u32, sample_rate: f32) -> AudioBuffer {
let vec = (0..number_of_channels).map(|_| Heap::default()).collect();
@@ -95,7 +95,7 @@ impl AudioBuffer {
)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
global: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/audiobuffersourcenode.rs b/components/script/dom/audiobuffersourcenode.rs
index efa0008491f..c7df916db5a 100644
--- a/components/script/dom/audiobuffersourcenode.rs
+++ b/components/script/dom/audiobuffersourcenode.rs
@@ -42,7 +42,7 @@ pub struct AudioBufferSourceNode {
}
impl AudioBufferSourceNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(
window: &Window,
context: &BaseAudioContext,
@@ -105,7 +105,7 @@ impl AudioBufferSourceNode {
Self::new_with_proto(window, None, context, options)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/audiocontext.rs b/components/script/dom/audiocontext.rs
index b18f5f62dab..524aae9d647 100644
--- a/components/script/dom/audiocontext.rs
+++ b/components/script/dom/audiocontext.rs
@@ -46,7 +46,7 @@ pub struct AudioContext {
}
impl AudioContext {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
// https://webaudio.github.io/web-audio-api/#AudioContext-constructors
fn new_inherited(options: &AudioContextOptions, pipeline_id: PipelineId) -> AudioContext {
// Steps 1-3.
@@ -78,7 +78,7 @@ impl AudioContext {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/audiodestinationnode.rs b/components/script/dom/audiodestinationnode.rs
index ec1beb116bb..a63daaf4587 100644
--- a/components/script/dom/audiodestinationnode.rs
+++ b/components/script/dom/audiodestinationnode.rs
@@ -37,7 +37,7 @@ impl AudioDestinationNode {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
global: &GlobalScope,
context: &BaseAudioContext,
diff --git a/components/script/dom/audiolistener.rs b/components/script/dom/audiolistener.rs
index d6c7b8151c3..e26389b0c8c 100644
--- a/components/script/dom/audiolistener.rs
+++ b/components/script/dom/audiolistener.rs
@@ -142,7 +142,7 @@ impl AudioListener {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(window: &Window, context: &BaseAudioContext) -> DomRoot<AudioListener> {
let node = AudioListener::new_inherited(window, context);
reflect_dom_object(Box::new(node), window)
diff --git a/components/script/dom/audioparam.rs b/components/script/dom/audioparam.rs
index 3d1ca25c77f..509252c1485 100644
--- a/components/script/dom/audioparam.rs
+++ b/components/script/dom/audioparam.rs
@@ -58,7 +58,7 @@ impl AudioParam {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
context: &BaseAudioContext,
diff --git a/components/script/dom/audioscheduledsourcenode.rs b/components/script/dom/audioscheduledsourcenode.rs
index 3337bb4c5cb..8c3229616ed 100644
--- a/components/script/dom/audioscheduledsourcenode.rs
+++ b/components/script/dom/audioscheduledsourcenode.rs
@@ -27,7 +27,7 @@ pub struct AudioScheduledSourceNode {
}
impl AudioScheduledSourceNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
node_type: AudioNodeInit,
context: &BaseAudioContext,
diff --git a/components/script/dom/baseaudiocontext.rs b/components/script/dom/baseaudiocontext.rs
index 9e0581c48e3..9673e964352 100644
--- a/components/script/dom/baseaudiocontext.rs
+++ b/components/script/dom/baseaudiocontext.rs
@@ -109,7 +109,7 @@ pub struct BaseAudioContext {
}
impl BaseAudioContext {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
options: BaseAudioContextOptions,
pipeline_id: PipelineId,
@@ -193,9 +193,9 @@ impl BaseAudioContext {
/// does not take a list of promises to fulfill. Callers cannot just pop
/// the front list off of `in_flight_resume_promises_queue` and later fulfill
/// the promises because that would mean putting
- /// `#[allow(unrooted_must_root)]` on even more functions, potentially
+ /// `#[allow(crown::unrooted_must_root)]` on even more functions, potentially
/// hiding actual safety bugs.
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn fulfill_in_flight_resume_promises<F>(&self, f: F)
where
F: FnOnce(),
diff --git a/components/script/dom/bindings/callback.rs b/components/script/dom/bindings/callback.rs
index 4554c34683c..0cad20d3255 100644
--- a/components/script/dom/bindings/callback.rs
+++ b/components/script/dom/bindings/callback.rs
@@ -42,7 +42,7 @@ pub enum ExceptionHandling {
/// A common base class for representing IDL callback function and
/// callback interface types.
#[derive(JSTraceable)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct CallbackObject {
/// The underlying `JSObject`.
callback: Heap<*mut JSObject>,
@@ -63,14 +63,14 @@ pub struct CallbackObject {
}
impl Default for CallbackObject {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn default() -> CallbackObject {
CallbackObject::new()
}
}
impl CallbackObject {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new() -> CallbackObject {
CallbackObject {
callback: Heap::default(),
@@ -133,14 +133,14 @@ pub trait CallbackContainer {
/// A common base class for representing IDL callback function types.
#[derive(JSTraceable, PartialEq)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct CallbackFunction {
object: CallbackObject,
}
impl CallbackFunction {
/// Create a new `CallbackFunction` for this object.
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new() -> CallbackFunction {
CallbackFunction {
object: CallbackObject::new(),
@@ -161,7 +161,7 @@ impl CallbackFunction {
/// A common base class for representing IDL callback interface types.
#[derive(JSTraceable, PartialEq)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct CallbackInterface {
object: CallbackObject,
}
@@ -241,7 +241,7 @@ pub struct CallSetup {
impl CallSetup {
/// Performs the setup needed to make a call.
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new<T: CallbackContainer>(callback: &T, handling: ExceptionHandling) -> CallSetup {
let global = unsafe { GlobalScope::from_object(callback.callback()) };
if let Some(window) = global.downcast::<Window>() {
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 471c152040b..361d6d60edb 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -6906,7 +6906,7 @@ class CGDictionary(CGThing):
derive = ["JSTraceable"]
mustRoot = ""
if self.membersNeedTracing():
- mustRoot = "#[unrooted_must_root_lint::must_root]\n"
+ mustRoot = "#[crown::unrooted_must_root_lint::must_root]\n"
if not self.hasRequiredFields(self.dictionary):
derive += ["Default"]
@@ -7450,7 +7450,7 @@ class CGCallback(CGClass):
constructors=self.getConstructors(),
methods=realMethods,
decorators="#[derive(JSTraceable, PartialEq)]\n"
- "#[unrooted_must_root_lint::allow_unrooted_interior]")
+ "#[crown::unrooted_must_root_lint::allow_unrooted_interior]")
def getConstructors(self):
return [ClassConstructor(
diff --git a/components/script/dom/bindings/mod.rs b/components/script/dom/bindings/mod.rs
index 9263fca2ba6..85bfad112c1 100644
--- a/components/script/dom/bindings/mod.rs
+++ b/components/script/dom/bindings/mod.rs
@@ -165,7 +165,7 @@ pub mod xmlname;
/// Generated JS-Rust bindings.
#[allow(missing_docs, non_snake_case)]
pub mod codegen {
- #[allow(dead_code, unrooted_must_root)]
+ #[allow(dead_code, crown::unrooted_must_root)]
pub mod Bindings {
include!(concat!(env!("OUT_DIR"), "/Bindings/mod.rs"));
}
diff --git a/components/script/dom/bindings/refcounted.rs b/components/script/dom/bindings/refcounted.rs
index 0279e98b6ba..3bf2dcef22e 100644
--- a/components/script/dom/bindings/refcounted.rs
+++ b/components/script/dom/bindings/refcounted.rs
@@ -80,7 +80,7 @@ impl TrustedPromise {
/// Create a new `TrustedPromise` instance from an existing DOM object. The object will
/// be prevented from being GCed for the duration of the resulting `TrustedPromise` object's
/// lifetime.
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(promise: Rc<Promise>) -> TrustedPromise {
LIVE_REFERENCES.with(|ref r| {
let r = r.borrow();
@@ -130,7 +130,7 @@ impl TrustedPromise {
}
/// A task which will reject the promise.
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn reject_task(self, error: Error) -> impl TaskOnce {
let this = self;
task!(reject_promise: move || {
@@ -140,7 +140,7 @@ impl TrustedPromise {
}
/// A task which will resolve the promise.
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn resolve_task<T>(self, value: T) -> impl TaskOnce
where
T: ToJSValConvertible + Send,
@@ -157,7 +157,7 @@ impl TrustedPromise {
/// shared among threads for use in asynchronous operations. The underlying
/// DOM object is guaranteed to live at least as long as the last outstanding
/// `Trusted<T>` instance.
-#[unrooted_must_root_lint::allow_unrooted_interior]
+#[crown::unrooted_must_root_lint::allow_unrooted_interior]
pub struct Trusted<T: DomObject> {
/// A pointer to the Rust DOM object of type T, but void to allow
/// sending `Trusted<T>` between threads, regardless of T's sendability.
@@ -220,7 +220,7 @@ impl<T: DomObject> Clone for Trusted<T> {
/// The set of live, pinned DOM objects that are currently prevented
/// from being garbage collected due to outstanding references.
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
pub struct LiveDOMReferences {
// keyed on pointer to Rust DOM object
reflectable_table: RefCell<HashMap<*const libc::c_void, Weak<TrustedReference>>>,
@@ -244,7 +244,7 @@ impl LiveDOMReferences {
});
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn addref_promise(&self, promise: Rc<Promise>) {
let mut table = self.promise_table.borrow_mut();
table.entry(&*promise).or_insert(vec![]).push(promise)
@@ -294,7 +294,7 @@ fn remove_nulls<K: Eq + Hash + Clone, V>(table: &mut HashMap<K, Weak<V>>) {
}
/// A JSTraceDataOp for tracing reflectors held in LIVE_REFERENCES
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
pub unsafe fn trace_refcounted_objects(tracer: *mut JSTracer) {
info!("tracing live refcounted references");
LIVE_REFERENCES.with(|ref r| {
diff --git a/components/script/dom/bindings/reflector.rs b/components/script/dom/bindings/reflector.rs
index 4b1ba97c525..081fe38312b 100644
--- a/components/script/dom/bindings/reflector.rs
+++ b/components/script/dom/bindings/reflector.rs
@@ -42,16 +42,16 @@ where
}
/// A struct to store a reference to the reflector of a DOM object.
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
#[derive(MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
// If you're renaming or moving this field, update the path in plugins::reflector as well
pub struct Reflector {
#[ignore_malloc_size_of = "defined and measured in rust-mozjs"]
object: Heap<*mut JSObject>,
}
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
impl PartialEq for Reflector {
fn eq(&self, other: &Reflector) -> bool {
self.object.get() == other.object.get()
diff --git a/components/script/dom/bindings/root.rs b/components/script/dom/bindings/root.rs
index 1e67474ea99..68f754628bc 100644
--- a/components/script/dom/bindings/root.rs
+++ b/components/script/dom/bindings/root.rs
@@ -44,8 +44,8 @@ use crate::dom::bindings::trace::{trace_reflector, JSTraceable};
use crate::dom::node::Node;
/// A rooted value.
-#[allow(unrooted_must_root)]
-#[unrooted_must_root_lint::allow_unrooted_interior]
+#[allow(crown::unrooted_must_root)]
+#[crown::unrooted_must_root_lint::allow_unrooted_interior]
pub struct Root<T: StableTraceObject> {
/// The value to root.
value: T,
@@ -60,7 +60,7 @@ where
/// Create a new stack-bounded root for the provided value.
/// It cannot outlive its associated `RootCollection`, and it gives
/// out references which cannot outlive this new `Root`.
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub unsafe fn new(value: T) -> Self {
unsafe fn add_to_root_list(object: *const dyn JSTraceable) -> *const RootCollection {
assert_in_script();
@@ -92,7 +92,7 @@ where
// The JSTraceable impl for Reflector doesn't actually do anything,
// so we need this shenanigan to actually trace the reflector of the
// T pointer in Dom<T>.
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
struct ReflectorStackRoot(Reflector);
unsafe impl JSTraceable for ReflectorStackRoot {
unsafe fn trace(&self, tracer: *mut JSTracer) {
@@ -111,7 +111,7 @@ where
// The JSTraceable impl for Reflector doesn't actually do anything,
// so we need this shenanigan to actually trace the reflector of the
// T pointer in Dom<T>.
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
struct MaybeUnreflectedStackRoot<T>(T);
unsafe impl<T> JSTraceable for MaybeUnreflectedStackRoot<T>
where
@@ -316,7 +316,7 @@ where
/// on the stack, the `Dom<T>` can point to freed memory.
///
/// This should only be used as a field in other DOM objects.
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct Dom<T> {
ptr: ptr::NonNull<T>,
}
@@ -341,7 +341,7 @@ impl<T> Dom<T> {
impl<T: DomObject> Dom<T> {
/// Create a Dom<T> from a &T
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn from_ref(obj: &T) -> Dom<T> {
assert_in_script();
Dom {
@@ -375,7 +375,7 @@ unsafe impl<T: DomObject> JSTraceable for Dom<T> {
}
/// A traced reference to a DOM object that may not be reflected yet.
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct MaybeUnreflectedDom<T> {
ptr: ptr::NonNull<T>,
}
@@ -384,7 +384,7 @@ impl<T> MaybeUnreflectedDom<T>
where
T: DomObject,
{
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub unsafe fn from_box(value: Box<T>) -> Self {
Self {
ptr: Box::leak(value).into(),
@@ -416,7 +416,7 @@ where
/// An unrooted reference to a DOM object for use in layout. `Layout*Helpers`
/// traits must be implemented on this.
-#[unrooted_must_root_lint::allow_unrooted_interior]
+#[crown::unrooted_must_root_lint::allow_unrooted_interior]
pub struct LayoutDom<'dom, T> {
value: &'dom T,
}
@@ -505,7 +505,7 @@ impl<T> Hash for LayoutDom<'_, T> {
impl<T> Clone for Dom<T> {
#[inline]
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn clone(&self) -> Self {
assert_in_script();
Dom {
@@ -539,7 +539,7 @@ impl LayoutDom<'_, Node> {
///
/// This should only be used as a field in other DOM objects; see warning
/// on `Dom<T>`.
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(JSTraceable)]
pub struct MutDom<T: DomObject> {
val: UnsafeCell<Dom<T>>,
@@ -602,7 +602,7 @@ pub(crate) fn assert_in_layout() {
///
/// This should only be used as a field in other DOM objects; see warning
/// on `Dom<T>`.
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(JSTraceable)]
pub struct MutNullableDom<T: DomObject> {
ptr: UnsafeCell<Option<Dom<T>>>,
@@ -636,14 +636,14 @@ impl<T: DomObject> MutNullableDom<T> {
/// Retrieve a copy of the inner optional `Dom<T>` as `LayoutDom<T>`.
/// For use by layout, which can't use safe types like Temporary.
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub unsafe fn get_inner_as_layout(&self) -> Option<LayoutDom<T>> {
assert_in_layout();
(*self.ptr.get()).as_ref().map(|js| js.to_layout())
}
/// Get a rooted value out of this object
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn get(&self) -> Option<DomRoot<T>> {
assert_in_script();
unsafe { ptr::read(self.ptr.get()).map(|o| DomRoot::from_ref(&*o)) }
@@ -678,7 +678,7 @@ impl<'a, T: DomObject> PartialEq<Option<&'a T>> for MutNullableDom<T> {
}
impl<T: DomObject> Default for MutNullableDom<T> {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn default() -> MutNullableDom<T> {
assert_in_script();
MutNullableDom {
@@ -700,7 +700,7 @@ impl<T: DomObject> MallocSizeOf for MutNullableDom<T> {
///
/// This should only be used as a field in other DOM objects; see warning
/// on `Dom<T>`.
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct DomOnceCell<T: DomObject> {
ptr: OnceCell<Dom<T>>,
}
@@ -711,7 +711,7 @@ where
{
/// Retrieve a copy of the current inner value. If it is `None`, it is
/// initialized with the result of `cb` first.
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn init_once<F>(&self, cb: F) -> &T
where
F: FnOnce() -> DomRoot<T>,
@@ -722,7 +722,7 @@ where
}
impl<T: DomObject> Default for DomOnceCell<T> {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn default() -> DomOnceCell<T> {
assert_in_script();
DomOnceCell {
@@ -738,7 +738,7 @@ impl<T: DomObject> MallocSizeOf for DomOnceCell<T> {
}
}
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
unsafe impl<T: DomObject> JSTraceable for DomOnceCell<T> {
unsafe fn trace(&self, trc: *mut JSTracer) {
if let Some(ptr) = self.ptr.get() {
diff --git a/components/script/dom/bindings/settings_stack.rs b/components/script/dom/bindings/settings_stack.rs
index 6461a790025..f25de95ee7c 100644
--- a/components/script/dom/bindings/settings_stack.rs
+++ b/components/script/dom/bindings/settings_stack.rs
@@ -20,7 +20,7 @@ enum StackEntryKind {
Entry,
}
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
#[derive(JSTraceable)]
struct StackEntry {
global: Dom<GlobalScope>,
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs
index 99abcf07e3d..3d730dff605 100644
--- a/components/script/dom/bindings/trace.rs
+++ b/components/script/dom/bindings/trace.rs
@@ -100,7 +100,7 @@ unsafe impl<T: JSTraceable> CustomTraceable for OnceCell<T> {
///
/// SAFETY: Inner type must not impl JSTraceable
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
-#[trace_in_no_trace_lint::must_not_have_traceable]
+#[crown::trace_in_no_trace_lint::must_not_have_traceable]
pub struct NoTrace<T>(pub T);
impl<T: Display> Display for NoTrace<T> {
@@ -130,7 +130,7 @@ impl<T: MallocSizeOf> MallocSizeOf for NoTrace<T> {
/// HashMap wrapper, that has non-jsmanaged keys
///
/// Not all methods are reexposed, but you can access inner type via .0
-#[trace_in_no_trace_lint::must_not_have_traceable(0)]
+#[crown::trace_in_no_trace_lint::must_not_have_traceable(0)]
#[derive(Clone, Debug)]
pub struct HashMapTracedValues<K, V, S = RandomState>(pub HashMap<K, V, S>);
@@ -276,7 +276,7 @@ pub fn trace_jsval(tracer: *mut JSTracer, description: &str, val: &Heap<JSVal>)
}
/// Trace the `JSObject` held by `reflector`.
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
pub fn trace_reflector(tracer: *mut JSTracer, description: &str, reflector: &Reflector) {
trace!("tracing reflector {}", description);
trace_object(tracer, description, reflector.rootable())
@@ -482,7 +482,7 @@ pub use js::gc::RootedTraceableSet;
/// If you have GC things like *mut JSObject or JSVal, use rooted!.
/// If you have an arbitrary number of DomObjects to root, use rooted_vec!.
/// If you know what you're doing, use this.
-#[unrooted_must_root_lint::allow_unrooted_interior]
+#[crown::unrooted_must_root_lint::allow_unrooted_interior]
pub struct RootedTraceableBox<T: JSTraceable + 'static>(js::gc::RootedTraceableBox<T>);
unsafe impl<T: JSTraceable + 'static> JSTraceable for RootedTraceableBox<T> {
@@ -547,9 +547,9 @@ impl<T: JSTraceable> DerefMut for RootedTraceableBox<T> {
/// Guaranteed to be empty when not rooted.
/// Usage: `rooted_vec!(let mut v);` or if you have an
/// iterator of `DomRoot`s, `rooted_vec!(let v <- iterator);`.
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
#[derive(JSTraceable)]
-#[unrooted_must_root_lint::allow_unrooted_interior]
+#[crown::unrooted_must_root_lint::allow_unrooted_interior]
pub struct RootableVec<T: JSTraceable> {
v: Vec<T>,
}
@@ -562,7 +562,7 @@ impl<T: JSTraceable> RootableVec<T> {
}
/// A vector of items that are rooted for the lifetime 'a.
-#[unrooted_must_root_lint::allow_unrooted_interior]
+#[crown::unrooted_must_root_lint::allow_unrooted_interior]
pub struct RootedVec<'a, T: 'static + JSTraceable> {
root: &'a mut RootableVec<T>,
}
diff --git a/components/script/dom/bindings/weakref.rs b/components/script/dom/bindings/weakref.rs
index a0bd0ea362d..57bf219de4f 100644
--- a/components/script/dom/bindings/weakref.rs
+++ b/components/script/dom/bindings/weakref.rs
@@ -33,14 +33,14 @@ use crate::dom::bindings::trace::JSTraceable;
pub const DOM_WEAK_SLOT: u32 = 1;
/// A weak reference to a JS-managed DOM object.
-#[allow(unrooted_must_root)]
-#[unrooted_must_root_lint::allow_unrooted_interior]
+#[allow(crown::unrooted_must_root)]
+#[crown::unrooted_must_root_lint::allow_unrooted_interior]
pub struct WeakRef<T: WeakReferenceable> {
ptr: ptr::NonNull<WeakBox<T>>,
}
/// The inner box of weak references, public for the finalization in codegen.
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct WeakBox<T: WeakReferenceable> {
/// The reference count. When it reaches zero, the `value` field should
/// have already been set to `None`. The pointee contributes one to the count.
@@ -218,7 +218,7 @@ unsafe impl<T: WeakReferenceable> JSTraceable for MutableWeakRef<T> {
/// A vector of weak references. On tracing, the vector retains
/// only references which still point to live objects.
-#[unrooted_must_root_lint::allow_unrooted_interior]
+#[crown::unrooted_must_root_lint::allow_unrooted_interior]
#[derive(MallocSizeOf)]
pub struct WeakRefVec<T: WeakReferenceable> {
vec: Vec<WeakRef<T>>,
@@ -268,7 +268,7 @@ impl<T: WeakReferenceable> DerefMut for WeakRefVec<T> {
/// An entry of a vector of weak references. Passed to the closure
/// given to `WeakRefVec::update`.
-#[unrooted_must_root_lint::allow_unrooted_interior]
+#[crown::unrooted_must_root_lint::allow_unrooted_interior]
pub struct WeakRefEntry<'a, T: WeakReferenceable> {
vec: &'a mut WeakRefVec<T>,
index: &'a mut usize,
diff --git a/components/script/dom/biquadfilternode.rs b/components/script/dom/biquadfilternode.rs
index f730da15651..53daa65c2df 100644
--- a/components/script/dom/biquadfilternode.rs
+++ b/components/script/dom/biquadfilternode.rs
@@ -39,7 +39,7 @@ pub struct BiquadFilterNode {
}
impl BiquadFilterNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
window: &Window,
context: &BaseAudioContext,
@@ -116,7 +116,7 @@ impl BiquadFilterNode {
Self::new_with_proto(window, None, context, options)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs
index 1b710124368..f2ae708d91d 100644
--- a/components/script/dom/blob.rs
+++ b/components/script/dom/blob.rs
@@ -56,7 +56,7 @@ impl Blob {
dom_blob
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(blob_impl: &BlobImpl) -> Blob {
Blob {
reflector_: Reflector::new(),
diff --git a/components/script/dom/bluetooth.rs b/components/script/dom/bluetooth.rs
index 9e25fa478d9..7b7aa791b0a 100644
--- a/components/script/dom/bluetooth.rs
+++ b/components/script/dom/bluetooth.rs
@@ -113,7 +113,7 @@ impl<T> BluetoothContext<T>
where
T: AsyncBluetoothListener + DomObject,
{
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn response(&mut self, response: BluetoothResponseResult) {
let promise = self.promise.take().expect("bt promise is missing").root();
@@ -737,7 +737,7 @@ impl PermissionAlgorithm for Bluetooth {
// NOTE: Step 3. is in BluetoothPermissionResult's `handle_response` function.
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
// https://webbluetoothcg.github.io/web-bluetooth/#revoke-bluetooth-access
fn permission_revoke(
_descriptor: &BluetoothPermissionDescriptor,
diff --git a/components/script/dom/bluetoothdevice.rs b/components/script/dom/bluetoothdevice.rs
index a2b9ecc330e..0d58c4f2f9d 100644
--- a/components/script/dom/bluetoothdevice.rs
+++ b/components/script/dom/bluetoothdevice.rs
@@ -187,7 +187,7 @@ impl BluetoothDevice {
}
// https://webbluetoothcg.github.io/web-bluetooth/#clean-up-the-disconnected-device
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn clean_up_disconnected_device(&self) {
// Step 1.
self.get_gatt().set_connected(false);
@@ -223,7 +223,7 @@ impl BluetoothDevice {
}
// https://webbluetoothcg.github.io/web-bluetooth/#garbage-collect-the-connection
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn garbage_collect_the_connection(&self) -> ErrorResult {
// Step 1: TODO: Check if other systems using this device.
diff --git a/components/script/dom/bluetoothpermissionresult.rs b/components/script/dom/bluetoothpermissionresult.rs
index 5b557555f18..76f22864c30 100644
--- a/components/script/dom/bluetoothpermissionresult.rs
+++ b/components/script/dom/bluetoothpermissionresult.rs
@@ -34,7 +34,7 @@ pub struct BluetoothPermissionResult {
}
impl BluetoothPermissionResult {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(status: &PermissionStatus) -> BluetoothPermissionResult {
let result = BluetoothPermissionResult {
status: PermissionStatus::new_inherited(status.get_query()),
@@ -74,7 +74,7 @@ impl BluetoothPermissionResult {
self.status.State()
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn set_devices(&self, devices: Vec<Dom<BluetoothDevice>>) {
*self.devices.borrow_mut() = devices;
}
diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs
index d10c577f56a..ef2394eadf7 100644
--- a/components/script/dom/canvasrenderingcontext2d.rs
+++ b/components/script/dom/canvasrenderingcontext2d.rs
@@ -175,7 +175,7 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
self.canvas_state.save()
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
// https://html.spec.whatwg.org/multipage/#dom-context-2d-restore
fn Restore(&self) {
self.canvas_state.restore()
diff --git a/components/script/dom/channelmergernode.rs b/components/script/dom/channelmergernode.rs
index 241e711c290..14acb96e1c3 100644
--- a/components/script/dom/channelmergernode.rs
+++ b/components/script/dom/channelmergernode.rs
@@ -24,7 +24,7 @@ pub struct ChannelMergerNode {
}
impl ChannelMergerNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
_: &Window,
context: &BaseAudioContext,
@@ -62,7 +62,7 @@ impl ChannelMergerNode {
Self::new_with_proto(window, None, context, options)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/channelsplitternode.rs b/components/script/dom/channelsplitternode.rs
index f6412242215..78982887d73 100644
--- a/components/script/dom/channelsplitternode.rs
+++ b/components/script/dom/channelsplitternode.rs
@@ -23,7 +23,7 @@ pub struct ChannelSplitterNode {
}
impl ChannelSplitterNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
_: &Window,
context: &BaseAudioContext,
@@ -64,7 +64,7 @@ impl ChannelSplitterNode {
Self::new_with_proto(window, None, context, options)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/constantsourcenode.rs b/components/script/dom/constantsourcenode.rs
index 4b9b8668706..88a4d5eaabc 100644
--- a/components/script/dom/constantsourcenode.rs
+++ b/components/script/dom/constantsourcenode.rs
@@ -29,7 +29,7 @@ pub struct ConstantSourceNode {
}
impl ConstantSourceNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(
window: &Window,
context: &BaseAudioContext,
@@ -69,7 +69,7 @@ impl ConstantSourceNode {
Self::new_with_proto(window, None, context, options)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/cssfontfacerule.rs b/components/script/dom/cssfontfacerule.rs
index edd175753c0..2e082260909 100644
--- a/components/script/dom/cssfontfacerule.rs
+++ b/components/script/dom/cssfontfacerule.rs
@@ -33,7 +33,7 @@ impl CSSFontFaceRule {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,
diff --git a/components/script/dom/cssimportrule.rs b/components/script/dom/cssimportrule.rs
index 857c5cd2909..3b4c3afcd41 100644
--- a/components/script/dom/cssimportrule.rs
+++ b/components/script/dom/cssimportrule.rs
@@ -33,7 +33,7 @@ impl CSSImportRule {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,
diff --git a/components/script/dom/csskeyframerule.rs b/components/script/dom/csskeyframerule.rs
index 743df167b68..a9d4b1fb9c7 100644
--- a/components/script/dom/csskeyframerule.rs
+++ b/components/script/dom/csskeyframerule.rs
@@ -38,7 +38,7 @@ impl CSSKeyframeRule {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,
diff --git a/components/script/dom/csskeyframesrule.rs b/components/script/dom/csskeyframesrule.rs
index 51a63c557e8..edd49fe62dc 100644
--- a/components/script/dom/csskeyframesrule.rs
+++ b/components/script/dom/csskeyframesrule.rs
@@ -42,7 +42,7 @@ impl CSSKeyframesRule {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,
diff --git a/components/script/dom/cssmediarule.rs b/components/script/dom/cssmediarule.rs
index 808c988add8..871a214f107 100644
--- a/components/script/dom/cssmediarule.rs
+++ b/components/script/dom/cssmediarule.rs
@@ -37,7 +37,7 @@ impl CSSMediaRule {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,
diff --git a/components/script/dom/cssnamespacerule.rs b/components/script/dom/cssnamespacerule.rs
index cd648e1338c..106dac18406 100644
--- a/components/script/dom/cssnamespacerule.rs
+++ b/components/script/dom/cssnamespacerule.rs
@@ -34,7 +34,7 @@ impl CSSNamespaceRule {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,
diff --git a/components/script/dom/cssrule.rs b/components/script/dom/cssrule.rs
index cd4da2b2b24..d3fd12f9948 100644
--- a/components/script/dom/cssrule.rs
+++ b/components/script/dom/cssrule.rs
@@ -36,7 +36,7 @@ pub struct CSSRule {
}
impl CSSRule {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(parent_stylesheet: &CSSStyleSheet) -> CSSRule {
CSSRule {
reflector_: Reflector::new(),
diff --git a/components/script/dom/cssrulelist.rs b/components/script/dom/cssrulelist.rs
index e279ffc51b9..ac345f4f22a 100644
--- a/components/script/dom/cssrulelist.rs
+++ b/components/script/dom/cssrulelist.rs
@@ -52,7 +52,7 @@ pub enum RulesSource {
}
impl CSSRuleList {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(parent_stylesheet: &CSSStyleSheet, rules: RulesSource) -> CSSRuleList {
let guard = parent_stylesheet.shared_lock().read();
let dom_rules = match rules {
@@ -78,7 +78,7 @@ impl CSSRuleList {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs
index 0f4f5b880f0..1cfa678cb3f 100644
--- a/components/script/dom/cssstyledeclaration.rs
+++ b/components/script/dom/cssstyledeclaration.rs
@@ -39,7 +39,7 @@ pub struct CSSStyleDeclaration {
}
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub enum CSSStyleOwner {
Element(Dom<Element>),
CSSRule(
@@ -209,7 +209,7 @@ fn remove_property(decls: &mut PropertyDeclarationBlock, id: &PropertyId) -> boo
}
impl CSSStyleDeclaration {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
owner: CSSStyleOwner,
pseudo: Option<PseudoElement>,
@@ -223,7 +223,7 @@ impl CSSStyleDeclaration {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
global: &Window,
owner: CSSStyleOwner,
diff --git a/components/script/dom/cssstylerule.rs b/components/script/dom/cssstylerule.rs
index e7cad8be137..a5d41d5d0d6 100644
--- a/components/script/dom/cssstylerule.rs
+++ b/components/script/dom/cssstylerule.rs
@@ -44,7 +44,7 @@ impl CSSStyleRule {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,
diff --git a/components/script/dom/cssstylesheet.rs b/components/script/dom/cssstylesheet.rs
index b7bf410ed36..64c57461871 100644
--- a/components/script/dom/cssstylesheet.rs
+++ b/components/script/dom/cssstylesheet.rs
@@ -50,7 +50,7 @@ impl CSSStyleSheet {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
owner: &Element,
diff --git a/components/script/dom/csssupportsrule.rs b/components/script/dom/csssupportsrule.rs
index 53714358b39..9d29ddfb6df 100644
--- a/components/script/dom/csssupportsrule.rs
+++ b/components/script/dom/csssupportsrule.rs
@@ -36,7 +36,7 @@ impl CSSSupportsRule {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,
diff --git a/components/script/dom/customelementregistry.rs b/components/script/dom/customelementregistry.rs
index eb0f49981e3..2f8e90e6808 100644
--- a/components/script/dom/customelementregistry.rs
+++ b/components/script/dom/customelementregistry.rs
@@ -248,7 +248,7 @@ fn get_callback(
}
impl CustomElementRegistryMethods for CustomElementRegistry {
- #[allow(unsafe_code, unrooted_must_root)]
+ #[allow(unsafe_code, crown::unrooted_must_root)]
/// <https://html.spec.whatwg.org/multipage/#dom-customelementregistry-define>
fn Define(
&self,
@@ -762,7 +762,7 @@ pub fn try_upgrade_element(element: &Element) {
}
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub enum CustomElementReaction {
Upgrade(#[ignore_malloc_size_of = "Rc"] Rc<CustomElementDefinition>),
Callback(
@@ -808,7 +808,7 @@ enum BackupElementQueueFlag {
/// <https://html.spec.whatwg.org/multipage/#custom-element-reactions-stack>
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct CustomElementReactionStack {
stack: DomRefCell<Vec<ElementQueue>>,
backup_queue: ElementQueue,
@@ -994,7 +994,7 @@ impl CustomElementReactionStack {
/// <https://html.spec.whatwg.org/multipage/#element-queue>
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
struct ElementQueue {
queue: DomRefCell<VecDeque<Dom<Element>>>,
}
diff --git a/components/script/dom/dissimilaroriginlocation.rs b/components/script/dom/dissimilaroriginlocation.rs
index cae89941ce6..da2221bf9f6 100644
--- a/components/script/dom/dissimilaroriginlocation.rs
+++ b/components/script/dom/dissimilaroriginlocation.rs
@@ -28,7 +28,7 @@ pub struct DissimilarOriginLocation {
}
impl DissimilarOriginLocation {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(window: &DissimilarOriginWindow) -> DissimilarOriginLocation {
DissimilarOriginLocation {
reflector: Reflector::new(),
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 38f2ca87066..0150891d5fd 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -224,7 +224,7 @@ pub enum IsHTMLDocument {
}
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
enum FocusTransaction {
/// No focus operation is in effect.
NotInTransaction,
@@ -2878,7 +2878,7 @@ impl Document {
.or_insert_with(|| Dom::from_ref(context));
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn flush_dirty_webgpu_canvases(&self) {
self.dirty_webgpu_contexts
.borrow_mut()
@@ -3817,7 +3817,7 @@ impl Document {
/// Add a stylesheet owned by `owner` to the list of document sheets, in the
/// correct tree position.
- #[allow(unrooted_must_root)] // Owner needs to be rooted already necessarily.
+ #[allow(crown::unrooted_must_root)] // Owner needs to be rooted already necessarily.
pub fn add_stylesheet(&self, owner: &Element, sheet: Arc<Stylesheet>) {
let stylesheets = &mut *self.stylesheets.borrow_mut();
let insertion_point = stylesheets
@@ -3850,7 +3850,7 @@ impl Document {
}
/// Remove a stylesheet owned by `owner` from the list of document sheets.
- #[allow(unrooted_must_root)] // Owner needs to be rooted already necessarily.
+ #[allow(crown::unrooted_must_root)] // Owner needs to be rooted already necessarily.
pub fn remove_stylesheet(&self, owner: &Element, s: &Arc<Stylesheet>) {
match self.window.layout_chan() {
Some(chan) => chan.send(Msg::RemoveStylesheet(s.clone())).unwrap(),
@@ -3876,7 +3876,7 @@ impl Document {
})
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn drain_pending_restyles(&self) -> Vec<(TrustedNodeAddress, PendingRestyle)> {
self.pending_restyles
.borrow_mut()
@@ -5358,7 +5358,7 @@ impl AnimationFrameCallback {
}
#[derive(Default, JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
struct PendingInOrderScriptVec {
scripts: DomRefCell<VecDeque<PendingScript>>,
}
@@ -5396,7 +5396,7 @@ impl PendingInOrderScriptVec {
}
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
struct PendingScript {
element: Dom<HTMLScriptElement>,
// TODO(sagudev): could this be all no_trace?
diff --git a/components/script/dom/documentorshadowroot.rs b/components/script/dom/documentorshadowroot.rs
index 647723e841f..9bbe435359b 100644
--- a/components/script/dom/documentorshadowroot.rs
+++ b/components/script/dom/documentorshadowroot.rs
@@ -27,7 +27,7 @@ use crate::dom::window::Window;
use crate::stylesheet_set::StylesheetSetRef;
#[derive(Clone, JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct StyleSheetInDocument {
#[ignore_malloc_size_of = "Arc"]
#[no_trace]
@@ -68,7 +68,7 @@ impl ::style::stylesheets::StylesheetInDocument for StyleSheetInDocument {
}
// https://w3c.github.io/webcomponents/spec/shadow/#extensions-to-the-documentorshadowroot-mixin
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(JSTraceable, MallocSizeOf)]
pub struct DocumentOrShadowRoot {
window: Dom<Window>,
@@ -199,7 +199,7 @@ impl DocumentOrShadowRoot {
}
/// Remove a stylesheet owned by `owner` from the list of document sheets.
- #[allow(unrooted_must_root)] // Owner needs to be rooted already necessarily.
+ #[allow(crown::unrooted_must_root)] // Owner needs to be rooted already necessarily.
pub fn remove_stylesheet(
owner: &Element,
s: &Arc<Stylesheet>,
@@ -220,7 +220,7 @@ impl DocumentOrShadowRoot {
/// Add a stylesheet owned by `owner` to the list of document sheets, in the
/// correct tree position.
- #[allow(unrooted_must_root)] // Owner needs to be rooted already necessarily.
+ #[allow(crown::unrooted_must_root)] // Owner needs to be rooted already necessarily.
pub fn add_stylesheet(
owner: &Element,
mut stylesheets: StylesheetSetRef<StyleSheetInDocument>,
diff --git a/components/script/dom/documenttype.rs b/components/script/dom/documenttype.rs
index f55eaac6c8f..3f2a0200db5 100644
--- a/components/script/dom/documenttype.rs
+++ b/components/script/dom/documenttype.rs
@@ -37,7 +37,7 @@ impl DocumentType {
system_id: system_id.unwrap_or_default(),
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
name: DOMString,
public_id: Option<DOMString>,
diff --git a/components/script/dom/dommatrix.rs b/components/script/dom/dommatrix.rs
index dd6aff6ea0f..23ec3a865c2 100644
--- a/components/script/dom/dommatrix.rs
+++ b/components/script/dom/dommatrix.rs
@@ -32,7 +32,7 @@ impl DOMMatrix {
Self::new_with_proto(global, None, is2D, matrix)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,
diff --git a/components/script/dom/dommatrixreadonly.rs b/components/script/dom/dommatrixreadonly.rs
index 02f4357b98f..26413b02452 100644
--- a/components/script/dom/dommatrixreadonly.rs
+++ b/components/script/dom/dommatrixreadonly.rs
@@ -46,7 +46,7 @@ impl DOMMatrixReadOnly {
Self::new_with_proto(global, None, is2D, matrix)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,
diff --git a/components/script/dom/dynamicmoduleowner.rs b/components/script/dom/dynamicmoduleowner.rs
index 28bd0636d3a..698ce88ee5a 100644
--- a/components/script/dom/dynamicmoduleowner.rs
+++ b/components/script/dom/dynamicmoduleowner.rs
@@ -30,7 +30,7 @@ pub struct DynamicModuleOwner {
}
impl DynamicModuleOwner {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(promise: Rc<Promise>, id: DynamicModuleId) -> Self {
DynamicModuleOwner {
reflector_: Reflector::new(),
@@ -39,7 +39,7 @@ impl DynamicModuleOwner {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(global: &GlobalScope, promise: Rc<Promise>, id: DynamicModuleId) -> DomRoot<Self> {
reflect_dom_object(
Box::new(DynamicModuleOwner::new_inherited(promise, id)),
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index cf8ab28a4e0..e0b9e93fdc7 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -3769,7 +3769,7 @@ impl ElementPerformFullscreenEnter {
}
impl TaskOnce for ElementPerformFullscreenEnter {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn run_once(self) {
let element = self.element.root();
let promise = self.promise.root();
@@ -3820,7 +3820,7 @@ impl ElementPerformFullscreenExit {
}
impl TaskOnce for ElementPerformFullscreenExit {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn run_once(self) {
let element = self.element.root();
let document = document_from_node(&*element);
diff --git a/components/script/dom/file.rs b/components/script/dom/file.rs
index 2e041e2112c..feddb935ecb 100644
--- a/components/script/dom/file.rs
+++ b/components/script/dom/file.rs
@@ -27,7 +27,7 @@ pub struct File {
}
impl File {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(blob_impl: &BlobImpl, name: DOMString, modified: Option<i64>) -> File {
File {
blob: Blob::new_inherited(blob_impl),
@@ -52,7 +52,7 @@ impl File {
Self::new_with_proto(global, None, blob_impl, name, modified)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,
diff --git a/components/script/dom/filelist.rs b/components/script/dom/filelist.rs
index 6b26bf2d722..d2b647273ba 100644
--- a/components/script/dom/filelist.rs
+++ b/components/script/dom/filelist.rs
@@ -20,7 +20,7 @@ pub struct FileList {
}
impl FileList {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(files: Vec<Dom<File>>) -> FileList {
FileList {
reflector_: Reflector::new(),
@@ -28,7 +28,7 @@ impl FileList {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(window: &Window, files: Vec<DomRoot<File>>) -> DomRoot<FileList> {
reflect_dom_object(
Box::new(FileList::new_inherited(
diff --git a/components/script/dom/formdata.rs b/components/script/dom/formdata.rs
index f0283695825..444062678f0 100644
--- a/components/script/dom/formdata.rs
+++ b/components/script/dom/formdata.rs
@@ -92,7 +92,7 @@ impl FormDataMethods for FormData {
.push((NoTrace(LocalName::from(name.0)), datum));
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
// https://xhr.spec.whatwg.org/#dom-formdata-append
fn Append_(&self, name: USVString, blob: &Blob, filename: Option<USVString>) {
let datum = FormDatum {
@@ -173,7 +173,7 @@ impl FormDataMethods for FormData {
));
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
// https://xhr.spec.whatwg.org/#dom-formdata-set
fn Set_(&self, name: USVString, blob: &Blob, filename: Option<USVString>) {
let mut data = self.data.borrow_mut();
diff --git a/components/script/dom/gainnode.rs b/components/script/dom/gainnode.rs
index 5bcb5cdff6f..e05a5d0f24c 100644
--- a/components/script/dom/gainnode.rs
+++ b/components/script/dom/gainnode.rs
@@ -30,7 +30,7 @@ pub struct GainNode {
}
impl GainNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
window: &Window,
context: &BaseAudioContext,
@@ -71,7 +71,7 @@ impl GainNode {
Self::new_with_proto(window, None, context, options)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/gamepadbuttonlist.rs b/components/script/dom/gamepadbuttonlist.rs
index 07bf5118f51..e28e33e05a8 100644
--- a/components/script/dom/gamepadbuttonlist.rs
+++ b/components/script/dom/gamepadbuttonlist.rs
@@ -19,7 +19,7 @@ pub struct GamepadButtonList {
// TODO: support gamepad discovery
#[allow(dead_code)]
impl GamepadButtonList {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(list: &[&GamepadButton]) -> GamepadButtonList {
GamepadButtonList {
reflector_: Reflector::new(),
diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs
index 248bd5ba337..6a1467d7076 100644
--- a/components/script/dom/globalscope.rs
+++ b/components/script/dom/globalscope.rs
@@ -418,7 +418,7 @@ enum BlobResult {
/// Data representing a message-port managed by this global.
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct ManagedMessagePort {
/// The DOM port.
dom_port: Dom<MessagePort>,
@@ -438,7 +438,7 @@ pub struct ManagedMessagePort {
/// State representing whether this global is currently managing broadcast channels.
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub enum BroadcastChannelState {
/// The broadcast-channel router id for this global, and a queue of managed channels.
/// Step 9, "sort destinations"
@@ -455,7 +455,7 @@ pub enum BroadcastChannelState {
/// State representing whether this global is currently managing messageports.
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub enum MessagePortState {
/// The message-port router id for this global, and a map of managed ports.
Managed(
diff --git a/components/script/dom/gpu.rs b/components/script/dom/gpu.rs
index def7c4c3883..af8620c3a8c 100644
--- a/components/script/dom/gpu.rs
+++ b/components/script/dom/gpu.rs
@@ -54,7 +54,7 @@ struct WGPUResponse<T: AsyncWGPUListener + DomObject> {
}
impl<T: AsyncWGPUListener + DomObject> WGPUResponse<T> {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn response(self, response: WebGPUResponseResult) {
let promise = self.trusted.root();
self.receiver.root().handle_response(response, &promise);
diff --git a/components/script/dom/gpusupportedfeatures.rs b/components/script/dom/gpusupportedfeatures.rs
index 9cdde31c45e..e0abd5b9def 100644
--- a/components/script/dom/gpusupportedfeatures.rs
+++ b/components/script/dom/gpusupportedfeatures.rs
@@ -126,7 +126,7 @@ impl FromStr for GPUFeatureName {
}
// this error is wrong because if we inline Self::Key and Self::Value all errors are gone
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
impl Setlike for GPUSupportedFeatures {
type Key = DOMString;
diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs
index ecae87f2d07..a347e3d6e9a 100644
--- a/components/script/dom/htmlanchorelement.rs
+++ b/components/script/dom/htmlanchorelement.rs
@@ -61,7 +61,7 @@ impl HTMLAnchorElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlareaelement.rs b/components/script/dom/htmlareaelement.rs
index 3d745ab64a8..4a414e21f04 100644
--- a/components/script/dom/htmlareaelement.rs
+++ b/components/script/dom/htmlareaelement.rs
@@ -251,7 +251,7 @@ impl HTMLAreaElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlaudioelement.rs b/components/script/dom/htmlaudioelement.rs
index ef9fa230f5f..d48c6c90ab3 100644
--- a/components/script/dom/htmlaudioelement.rs
+++ b/components/script/dom/htmlaudioelement.rs
@@ -34,7 +34,7 @@ impl HTMLAudioElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlbaseelement.rs b/components/script/dom/htmlbaseelement.rs
index 30e6ca7851a..59725b2161e 100644
--- a/components/script/dom/htmlbaseelement.rs
+++ b/components/script/dom/htmlbaseelement.rs
@@ -34,7 +34,7 @@ impl HTMLBaseElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs
index c70b716bbf4..e2275c4a095 100644
--- a/components/script/dom/htmlbodyelement.rs
+++ b/components/script/dom/htmlbodyelement.rs
@@ -43,7 +43,7 @@ impl HTMLBodyElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlbrelement.rs b/components/script/dom/htmlbrelement.rs
index 129aef7d4c3..a8e06cd4dd1 100644
--- a/components/script/dom/htmlbrelement.rs
+++ b/components/script/dom/htmlbrelement.rs
@@ -27,7 +27,7 @@ impl HTMLBRElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs
index 333f3538745..56c60fe2190 100755
--- a/components/script/dom/htmlbuttonelement.rs
+++ b/components/script/dom/htmlbuttonelement.rs
@@ -68,7 +68,7 @@ impl HTMLButtonElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs
index 4f82a54e5bd..bb35853f706 100644
--- a/components/script/dom/htmlcanvaselement.rs
+++ b/components/script/dom/htmlcanvaselement.rs
@@ -52,7 +52,7 @@ use crate::script_runtime::JSContext;
const DEFAULT_WIDTH: u32 = 300;
const DEFAULT_HEIGHT: u32 = 150;
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(Clone, JSTraceable, MallocSizeOf)]
pub enum CanvasContext {
Context2d(Dom<CanvasRenderingContext2D>),
@@ -79,7 +79,7 @@ impl HTMLCanvasElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs
index 560ea052392..dbbb7dffb6d 100644
--- a/components/script/dom/htmlcollection.rs
+++ b/components/script/dom/htmlcollection.rs
@@ -69,7 +69,7 @@ pub struct HTMLCollection {
}
impl HTMLCollection {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
root: &Node,
filter: Box<dyn CollectionFilter + 'static>,
@@ -99,7 +99,7 @@ impl HTMLCollection {
Self::new(window, root, Box::new(NoFilter))
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
root: &Node,
diff --git a/components/script/dom/htmldataelement.rs b/components/script/dom/htmldataelement.rs
index 725bdd4abcc..4b59199edb7 100644
--- a/components/script/dom/htmldataelement.rs
+++ b/components/script/dom/htmldataelement.rs
@@ -29,7 +29,7 @@ impl HTMLDataElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmldatalistelement.rs b/components/script/dom/htmldatalistelement.rs
index 311d1909f17..4d74e2aded5 100644
--- a/components/script/dom/htmldatalistelement.rs
+++ b/components/script/dom/htmldatalistelement.rs
@@ -32,7 +32,7 @@ impl HTMLDataListElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmldetailselement.rs b/components/script/dom/htmldetailselement.rs
index 7d10b1c91f3..f620f7d576a 100644
--- a/components/script/dom/htmldetailselement.rs
+++ b/components/script/dom/htmldetailselement.rs
@@ -39,7 +39,7 @@ impl HTMLDetailsElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmldialogelement.rs b/components/script/dom/htmldialogelement.rs
index 18d9eac65a0..bd21001ab6b 100644
--- a/components/script/dom/htmldialogelement.rs
+++ b/components/script/dom/htmldialogelement.rs
@@ -35,7 +35,7 @@ impl HTMLDialogElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmldirectoryelement.rs b/components/script/dom/htmldirectoryelement.rs
index 552d5572728..2b11f61fced 100644
--- a/components/script/dom/htmldirectoryelement.rs
+++ b/components/script/dom/htmldirectoryelement.rs
@@ -27,7 +27,7 @@ impl HTMLDirectoryElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmldivelement.rs b/components/script/dom/htmldivelement.rs
index d16ac4c6057..af25f8a6731 100644
--- a/components/script/dom/htmldivelement.rs
+++ b/components/script/dom/htmldivelement.rs
@@ -29,7 +29,7 @@ impl HTMLDivElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmldlistelement.rs b/components/script/dom/htmldlistelement.rs
index 970db5a221b..828927fbb69 100644
--- a/components/script/dom/htmldlistelement.rs
+++ b/components/script/dom/htmldlistelement.rs
@@ -27,7 +27,7 @@ impl HTMLDListElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs
index ffc9dd887a3..7d546f154fb 100644
--- a/components/script/dom/htmlelement.rs
+++ b/components/script/dom/htmlelement.rs
@@ -80,7 +80,7 @@ impl HTMLElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlembedelement.rs b/components/script/dom/htmlembedelement.rs
index ddfbc8675cd..714798cfe80 100644
--- a/components/script/dom/htmlembedelement.rs
+++ b/components/script/dom/htmlembedelement.rs
@@ -27,7 +27,7 @@ impl HTMLEmbedElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlfieldsetelement.rs b/components/script/dom/htmlfieldsetelement.rs
index ff5ac4e26bc..b29f4b471b0 100644
--- a/components/script/dom/htmlfieldsetelement.rs
+++ b/components/script/dom/htmlfieldsetelement.rs
@@ -50,7 +50,7 @@ impl HTMLFieldSetElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlfontelement.rs b/components/script/dom/htmlfontelement.rs
index 9d228516d38..fb1fa3f53a9 100644
--- a/components/script/dom/htmlfontelement.rs
+++ b/components/script/dom/htmlfontelement.rs
@@ -37,7 +37,7 @@ impl HTMLFontElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs
index 9896ec75cf8..bbd12d4d491 100644
--- a/components/script/dom/htmlformelement.rs
+++ b/components/script/dom/htmlformelement.rs
@@ -123,7 +123,7 @@ impl HTMLFormElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlframeelement.rs b/components/script/dom/htmlframeelement.rs
index 8dae2d38ce5..93b0dc0722b 100644
--- a/components/script/dom/htmlframeelement.rs
+++ b/components/script/dom/htmlframeelement.rs
@@ -27,7 +27,7 @@ impl HTMLFrameElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlframesetelement.rs b/components/script/dom/htmlframesetelement.rs
index db1ab1c314c..723435b7f46 100644
--- a/components/script/dom/htmlframesetelement.rs
+++ b/components/script/dom/htmlframesetelement.rs
@@ -30,7 +30,7 @@ impl HTMLFrameSetElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlheadelement.rs b/components/script/dom/htmlheadelement.rs
index 92e21e1efa5..ad95bbd9224 100644
--- a/components/script/dom/htmlheadelement.rs
+++ b/components/script/dom/htmlheadelement.rs
@@ -33,7 +33,7 @@ impl HTMLHeadElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlheadingelement.rs b/components/script/dom/htmlheadingelement.rs
index b701b5d7d7f..0cc17d69221 100644
--- a/components/script/dom/htmlheadingelement.rs
+++ b/components/script/dom/htmlheadingelement.rs
@@ -40,7 +40,7 @@ impl HTMLHeadingElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlhrelement.rs b/components/script/dom/htmlhrelement.rs
index 6bc4c4a73d7..f28a592000b 100644
--- a/components/script/dom/htmlhrelement.rs
+++ b/components/script/dom/htmlhrelement.rs
@@ -34,7 +34,7 @@ impl HTMLHRElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlhtmlelement.rs b/components/script/dom/htmlhtmlelement.rs
index c6c4566a605..7331a0f7513 100644
--- a/components/script/dom/htmlhtmlelement.rs
+++ b/components/script/dom/htmlhtmlelement.rs
@@ -29,7 +29,7 @@ impl HTMLHtmlElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
localName: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index 5481e108a60..4119bb9c86c 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -446,7 +446,7 @@ impl HTMLIFrameElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index be840f36f16..91ba8dc2499 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.rs
@@ -141,7 +141,7 @@ enum ImageRequestPhase {
Current,
}
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
struct ImageRequest {
state: State,
#[no_trace]
@@ -1249,7 +1249,7 @@ impl HTMLImageElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs
index 8c082a70e49..994691d956f 100755
--- a/components/script/dom/htmlinputelement.rs
+++ b/components/script/dom/htmlinputelement.rs
@@ -327,7 +327,7 @@ impl HTMLInputElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
@@ -2066,7 +2066,7 @@ impl HTMLInputElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn selection(&self) -> TextControlSelection<Self> {
TextControlSelection::new(&self, &self.textinput)
}
diff --git a/components/script/dom/htmllabelelement.rs b/components/script/dom/htmllabelelement.rs
index 40d871e3415..6c5ba56cfb3 100644
--- a/components/script/dom/htmllabelelement.rs
+++ b/components/script/dom/htmllabelelement.rs
@@ -42,7 +42,7 @@ impl HTMLLabelElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmllegendelement.rs b/components/script/dom/htmllegendelement.rs
index 2fd26acec77..a44037fdbba 100644
--- a/components/script/dom/htmllegendelement.rs
+++ b/components/script/dom/htmllegendelement.rs
@@ -36,7 +36,7 @@ impl HTMLLegendElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmllielement.rs b/components/script/dom/htmllielement.rs
index 58219171d3c..c3a7a8e1eee 100644
--- a/components/script/dom/htmllielement.rs
+++ b/components/script/dom/htmllielement.rs
@@ -32,7 +32,7 @@ impl HTMLLIElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs
index a9cd25e0510..d77212e2621 100644
--- a/components/script/dom/htmllinkelement.rs
+++ b/components/script/dom/htmllinkelement.rs
@@ -92,7 +92,7 @@ impl HTMLLinkElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
@@ -115,7 +115,7 @@ impl HTMLLinkElement {
// FIXME(emilio): These methods are duplicated with
// HTMLStyleElement::set_stylesheet.
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn set_stylesheet(&self, s: Arc<Stylesheet>) {
let stylesheets_owner = stylesheets_owner_from_node(self);
if let Some(ref s) = *self.stylesheet.borrow() {
diff --git a/components/script/dom/htmlmapelement.rs b/components/script/dom/htmlmapelement.rs
index 7367f188de7..adf7c7b1b24 100644
--- a/components/script/dom/htmlmapelement.rs
+++ b/components/script/dom/htmlmapelement.rs
@@ -29,7 +29,7 @@ impl HTMLMapElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs
index 6f2337b819f..824aadd1ee2 100644
--- a/components/script/dom/htmlmediaelement.rs
+++ b/components/script/dom/htmlmediaelement.rs
@@ -282,7 +282,7 @@ impl VideoFrameRenderer for MediaFrameRenderer {
}
}
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(JSTraceable, MallocSizeOf)]
enum SrcObject {
MediaStream(Dom<MediaStream>),
@@ -290,7 +290,7 @@ enum SrcObject {
}
impl From<MediaStreamOrBlob> for SrcObject {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn from(src_object: MediaStreamOrBlob) -> SrcObject {
match src_object {
MediaStreamOrBlob::Blob(blob) => SrcObject::Blob(Dom::from_ref(&*blob)),
@@ -1207,9 +1207,9 @@ impl HTMLMediaElement {
/// does not take a list of promises to fulfill. Callers cannot just pop
/// the front list off of `in_flight_play_promises_queue` and later fulfill
/// the promises because that would mean putting
- /// `#[allow(unrooted_must_root)]` on even more functions, potentially
+ /// `#[allow(crown::unrooted_must_root)]` on even more functions, potentially
/// hiding actual safety bugs.
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn fulfill_in_flight_play_promises<F>(&self, f: F)
where
F: FnOnce(),
diff --git a/components/script/dom/htmlmenuelement.rs b/components/script/dom/htmlmenuelement.rs
index 10ab5116f75..3d799f454f7 100644
--- a/components/script/dom/htmlmenuelement.rs
+++ b/components/script/dom/htmlmenuelement.rs
@@ -28,7 +28,7 @@ impl HTMLMenuElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlmetaelement.rs b/components/script/dom/htmlmetaelement.rs
index 4000035b0ca..61ec43ac96a 100644
--- a/components/script/dom/htmlmetaelement.rs
+++ b/components/script/dom/htmlmetaelement.rs
@@ -36,7 +36,7 @@ impl HTMLMetaElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlmeterelement.rs b/components/script/dom/htmlmeterelement.rs
index 03859ee9689..917258a1ea8 100644
--- a/components/script/dom/htmlmeterelement.rs
+++ b/components/script/dom/htmlmeterelement.rs
@@ -32,7 +32,7 @@ impl HTMLMeterElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlmodelement.rs b/components/script/dom/htmlmodelement.rs
index 68c731c189e..7a3356434b8 100644
--- a/components/script/dom/htmlmodelement.rs
+++ b/components/script/dom/htmlmodelement.rs
@@ -27,7 +27,7 @@ impl HTMLModElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlobjectelement.rs b/components/script/dom/htmlobjectelement.rs
index 06509e66497..4365034c2c8 100755
--- a/components/script/dom/htmlobjectelement.rs
+++ b/components/script/dom/htmlobjectelement.rs
@@ -49,7 +49,7 @@ impl HTMLObjectElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlolistelement.rs b/components/script/dom/htmlolistelement.rs
index cba1baad27d..1c4c928f8b3 100644
--- a/components/script/dom/htmlolistelement.rs
+++ b/components/script/dom/htmlolistelement.rs
@@ -27,7 +27,7 @@ impl HTMLOListElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmloptgroupelement.rs b/components/script/dom/htmloptgroupelement.rs
index 881ec922cd4..2d85c8f057c 100644
--- a/components/script/dom/htmloptgroupelement.rs
+++ b/components/script/dom/htmloptgroupelement.rs
@@ -42,7 +42,7 @@ impl HTMLOptGroupElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmloptionelement.rs b/components/script/dom/htmloptionelement.rs
index 6a919c84df3..37e6922f787 100644
--- a/components/script/dom/htmloptionelement.rs
+++ b/components/script/dom/htmloptionelement.rs
@@ -65,7 +65,7 @@ impl HTMLOptionElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmloutputelement.rs b/components/script/dom/htmloutputelement.rs
index e444a19c60d..01a3df05e6d 100644
--- a/components/script/dom/htmloutputelement.rs
+++ b/components/script/dom/htmloutputelement.rs
@@ -46,7 +46,7 @@ impl HTMLOutputElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlparagraphelement.rs b/components/script/dom/htmlparagraphelement.rs
index 0609f355575..9ac3367738a 100644
--- a/components/script/dom/htmlparagraphelement.rs
+++ b/components/script/dom/htmlparagraphelement.rs
@@ -27,7 +27,7 @@ impl HTMLParagraphElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlparamelement.rs b/components/script/dom/htmlparamelement.rs
index 4b550346877..c4490854f27 100644
--- a/components/script/dom/htmlparamelement.rs
+++ b/components/script/dom/htmlparamelement.rs
@@ -27,7 +27,7 @@ impl HTMLParamElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlpictureelement.rs b/components/script/dom/htmlpictureelement.rs
index 51b93857bfe..79313701b43 100644
--- a/components/script/dom/htmlpictureelement.rs
+++ b/components/script/dom/htmlpictureelement.rs
@@ -27,7 +27,7 @@ impl HTMLPictureElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlpreelement.rs b/components/script/dom/htmlpreelement.rs
index 9eb27ebd820..7d86b03de99 100644
--- a/components/script/dom/htmlpreelement.rs
+++ b/components/script/dom/htmlpreelement.rs
@@ -27,7 +27,7 @@ impl HTMLPreElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlprogresselement.rs b/components/script/dom/htmlprogresselement.rs
index 79d73b2e338..62f05a5c7db 100644
--- a/components/script/dom/htmlprogresselement.rs
+++ b/components/script/dom/htmlprogresselement.rs
@@ -34,7 +34,7 @@ impl HTMLProgressElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlquoteelement.rs b/components/script/dom/htmlquoteelement.rs
index acd8c3521be..3254ca5b7e7 100644
--- a/components/script/dom/htmlquoteelement.rs
+++ b/components/script/dom/htmlquoteelement.rs
@@ -27,7 +27,7 @@ impl HTMLQuoteElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs
index 9f0ad234662..e7b71e853e1 100644
--- a/components/script/dom/htmlscriptelement.rs
+++ b/components/script/dom/htmlscriptelement.rs
@@ -193,7 +193,7 @@ impl HTMLScriptElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlselectelement.rs b/components/script/dom/htmlselectelement.rs
index c4d133e922c..9b301fb6464 100755
--- a/components/script/dom/htmlselectelement.rs
+++ b/components/script/dom/htmlselectelement.rs
@@ -91,7 +91,7 @@ impl HTMLSelectElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlsourceelement.rs b/components/script/dom/htmlsourceelement.rs
index 7948fb90c7e..0ef9d96df2d 100644
--- a/components/script/dom/htmlsourceelement.rs
+++ b/components/script/dom/htmlsourceelement.rs
@@ -36,7 +36,7 @@ impl HTMLSourceElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlspanelement.rs b/components/script/dom/htmlspanelement.rs
index 1d323a65556..0f1617fc5bf 100644
--- a/components/script/dom/htmlspanelement.rs
+++ b/components/script/dom/htmlspanelement.rs
@@ -27,7 +27,7 @@ impl HTMLSpanElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlstyleelement.rs b/components/script/dom/htmlstyleelement.rs
index ebe0760560b..6d8a4f8769d 100644
--- a/components/script/dom/htmlstyleelement.rs
+++ b/components/script/dom/htmlstyleelement.rs
@@ -66,7 +66,7 @@ impl HTMLStyleElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
@@ -145,7 +145,7 @@ impl HTMLStyleElement {
}
// FIXME(emilio): This is duplicated with HTMLLinkElement::set_stylesheet.
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn set_stylesheet(&self, s: Arc<Stylesheet>) {
let stylesheets_owner = stylesheets_owner_from_node(self);
if let Some(ref s) = *self.stylesheet.borrow() {
diff --git a/components/script/dom/htmltablecaptionelement.rs b/components/script/dom/htmltablecaptionelement.rs
index c856c53c18a..959adb4d365 100644
--- a/components/script/dom/htmltablecaptionelement.rs
+++ b/components/script/dom/htmltablecaptionelement.rs
@@ -28,7 +28,7 @@ impl HTMLTableCaptionElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmltablecellelement.rs b/components/script/dom/htmltablecellelement.rs
index a6ab78177dc..4f55fbd4ea7 100644
--- a/components/script/dom/htmltablecellelement.rs
+++ b/components/script/dom/htmltablecellelement.rs
@@ -40,7 +40,7 @@ impl HTMLTableCellElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmltablecolelement.rs b/components/script/dom/htmltablecolelement.rs
index d2b9e1f9421..3829f595341 100644
--- a/components/script/dom/htmltablecolelement.rs
+++ b/components/script/dom/htmltablecolelement.rs
@@ -28,7 +28,7 @@ impl HTMLTableColElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmltableelement.rs b/components/script/dom/htmltableelement.rs
index 25c75e1820f..2bddc484499 100644
--- a/components/script/dom/htmltableelement.rs
+++ b/components/script/dom/htmltableelement.rs
@@ -37,7 +37,7 @@ pub struct HTMLTableElement {
tbodies: MutNullableDom<HTMLCollection>,
}
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
#[derive(JSTraceable, MallocSizeOf)]
struct TableRowFilter {
sections: Vec<Dom<Node>>,
@@ -67,7 +67,7 @@ impl HTMLTableElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmltablerowelement.rs b/components/script/dom/htmltablerowelement.rs
index 79f154c4256..a5fe4e2fec6 100644
--- a/components/script/dom/htmltablerowelement.rs
+++ b/components/script/dom/htmltablerowelement.rs
@@ -53,7 +53,7 @@ impl HTMLTableRowElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmltablesectionelement.rs b/components/script/dom/htmltablesectionelement.rs
index 24a85fb1b1a..9daf6393154 100644
--- a/components/script/dom/htmltablesectionelement.rs
+++ b/components/script/dom/htmltablesectionelement.rs
@@ -38,7 +38,7 @@ impl HTMLTableSectionElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmltemplateelement.rs b/components/script/dom/htmltemplateelement.rs
index 4938c25a14d..fcfd06ad74d 100644
--- a/components/script/dom/htmltemplateelement.rs
+++ b/components/script/dom/htmltemplateelement.rs
@@ -37,7 +37,7 @@ impl HTMLTemplateElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs
index ca77d6cefad..52531847665 100755
--- a/components/script/dom/htmltextareaelement.rs
+++ b/components/script/dom/htmltextareaelement.rs
@@ -172,7 +172,7 @@ impl HTMLTextAreaElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
@@ -454,7 +454,7 @@ impl HTMLTextAreaElement {
self.value_dirty.set(false);
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn selection(&self) -> TextControlSelection<Self> {
TextControlSelection::new(&self, &self.textinput)
}
diff --git a/components/script/dom/htmltimeelement.rs b/components/script/dom/htmltimeelement.rs
index 4af4acfc888..40b1c685ebb 100644
--- a/components/script/dom/htmltimeelement.rs
+++ b/components/script/dom/htmltimeelement.rs
@@ -29,7 +29,7 @@ impl HTMLTimeElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmltitleelement.rs b/components/script/dom/htmltitleelement.rs
index 24572c0f7e1..2c308c6c77a 100644
--- a/components/script/dom/htmltitleelement.rs
+++ b/components/script/dom/htmltitleelement.rs
@@ -32,7 +32,7 @@ impl HTMLTitleElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlulistelement.rs b/components/script/dom/htmlulistelement.rs
index f0820c0f3ae..faa1eb97d59 100644
--- a/components/script/dom/htmlulistelement.rs
+++ b/components/script/dom/htmlulistelement.rs
@@ -27,7 +27,7 @@ impl HTMLUListElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlunknownelement.rs b/components/script/dom/htmlunknownelement.rs
index c87c104d66b..70d77feeabe 100644
--- a/components/script/dom/htmlunknownelement.rs
+++ b/components/script/dom/htmlunknownelement.rs
@@ -27,7 +27,7 @@ impl HTMLUnknownElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/htmlvideoelement.rs b/components/script/dom/htmlvideoelement.rs
index 39bfabfb6d0..9149acedede 100644
--- a/components/script/dom/htmlvideoelement.rs
+++ b/components/script/dom/htmlvideoelement.rs
@@ -83,7 +83,7 @@ impl HTMLVideoElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs
index 4b32a54d6aa..e9b48731280 100644
--- a/components/script/dom/macros.rs
+++ b/components/script/dom/macros.rs
@@ -597,7 +597,7 @@ macro_rules! impl_performance_entry_struct(
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(global: &GlobalScope,
name: DOMString,
start_time: f64,
diff --git a/components/script/dom/mediaelementaudiosourcenode.rs b/components/script/dom/mediaelementaudiosourcenode.rs
index 4efc43e0418..bb874f0f482 100644
--- a/components/script/dom/mediaelementaudiosourcenode.rs
+++ b/components/script/dom/mediaelementaudiosourcenode.rs
@@ -27,7 +27,7 @@ pub struct MediaElementAudioSourceNode {
}
impl MediaElementAudioSourceNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(
context: &AudioContext,
media_element: &HTMLMediaElement,
@@ -60,7 +60,7 @@ impl MediaElementAudioSourceNode {
Self::new_with_proto(window, None, context, media_element)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/medialist.rs b/components/script/dom/medialist.rs
index f099c327f65..4874e044bca 100644
--- a/components/script/dom/medialist.rs
+++ b/components/script/dom/medialist.rs
@@ -29,7 +29,7 @@ pub struct MediaList {
}
impl MediaList {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
parent_stylesheet: &CSSStyleSheet,
media_queries: Arc<Locked<StyleMediaList>>,
@@ -41,7 +41,7 @@ impl MediaList {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,
diff --git a/components/script/dom/mediasession.rs b/components/script/dom/mediasession.rs
index 14ca4c14494..b1907c4678c 100644
--- a/components/script/dom/mediasession.rs
+++ b/components/script/dom/mediasession.rs
@@ -48,7 +48,7 @@ pub struct MediaSession {
}
impl MediaSession {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited() -> MediaSession {
let media_session = MediaSession {
reflector_: Reflector::new(),
diff --git a/components/script/dom/mediastreamaudiodestinationnode.rs b/components/script/dom/mediastreamaudiodestinationnode.rs
index 7409cfa98e2..1950ce34a26 100644
--- a/components/script/dom/mediastreamaudiodestinationnode.rs
+++ b/components/script/dom/mediastreamaudiodestinationnode.rs
@@ -28,7 +28,7 @@ pub struct MediaStreamAudioDestinationNode {
}
impl MediaStreamAudioDestinationNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
context: &AudioContext,
options: &AudioNodeOptions,
@@ -62,7 +62,7 @@ impl MediaStreamAudioDestinationNode {
Self::new_with_proto(window, None, context, options)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/mediastreamaudiosourcenode.rs b/components/script/dom/mediastreamaudiosourcenode.rs
index c56851912db..4f273f960b2 100644
--- a/components/script/dom/mediastreamaudiosourcenode.rs
+++ b/components/script/dom/mediastreamaudiosourcenode.rs
@@ -26,7 +26,7 @@ pub struct MediaStreamAudioSourceNode {
}
impl MediaStreamAudioSourceNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
context: &AudioContext,
stream: &MediaStream,
@@ -58,7 +58,7 @@ impl MediaStreamAudioSourceNode {
Self::new_with_proto(window, None, context, stream)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/mediastreamtrackaudiosourcenode.rs b/components/script/dom/mediastreamtrackaudiosourcenode.rs
index fa8b480764d..c5d8c18cb2c 100644
--- a/components/script/dom/mediastreamtrackaudiosourcenode.rs
+++ b/components/script/dom/mediastreamtrackaudiosourcenode.rs
@@ -23,7 +23,7 @@ pub struct MediaStreamTrackAudioSourceNode {
}
impl MediaStreamTrackAudioSourceNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
context: &AudioContext,
track: &MediaStreamTrack,
@@ -49,7 +49,7 @@ impl MediaStreamTrackAudioSourceNode {
Self::new_with_proto(window, None, context, track)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/messageevent.rs b/components/script/dom/messageevent.rs
index d398f67a309..690fe5b09a6 100644
--- a/components/script/dom/messageevent.rs
+++ b/components/script/dom/messageevent.rs
@@ -28,7 +28,7 @@ use crate::dom::serviceworker::ServiceWorker;
use crate::dom::windowproxy::WindowProxy;
use crate::script_runtime::JSContext;
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(JSTraceable, MallocSizeOf)]
enum SrcObject {
WindowProxy(Dom<WindowProxy>),
@@ -37,7 +37,7 @@ enum SrcObject {
}
impl From<&WindowProxyOrMessagePortOrServiceWorker> for SrcObject {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn from(src_object: &WindowProxyOrMessagePortOrServiceWorker) -> SrcObject {
match src_object {
WindowProxyOrMessagePortOrServiceWorker::WindowProxy(blob) => {
diff --git a/components/script/dom/mutationrecord.rs b/components/script/dom/mutationrecord.rs
index ad9638e6b30..c029baee036 100644
--- a/components/script/dom/mutationrecord.rs
+++ b/components/script/dom/mutationrecord.rs
@@ -27,7 +27,7 @@ pub struct MutationRecord {
}
impl MutationRecord {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn attribute_mutated(
target: &Node,
attribute_name: &LocalName,
diff --git a/components/script/dom/navigationpreloadmanager.rs b/components/script/dom/navigationpreloadmanager.rs
index 011ad438f5c..7aa200b4306 100644
--- a/components/script/dom/navigationpreloadmanager.rs
+++ b/components/script/dom/navigationpreloadmanager.rs
@@ -33,7 +33,7 @@ impl NavigationPreloadManager {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
global: &GlobalScope,
registration: &ServiceWorkerRegistration,
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 2470e890939..b2c95c5f92a 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -1786,7 +1786,7 @@ impl Node {
Node::new_(NodeFlags::new(), Some(doc))
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_document_node() -> Node {
Node::new_(
NodeFlags::new() | NodeFlags::IS_IN_DOC | NodeFlags::IS_CONNECTED,
@@ -1794,7 +1794,7 @@ impl Node {
)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_(flags: NodeFlags, doc: Option<&Document>) -> Node {
Node {
eventtarget: EventTarget::new_inherited(),
@@ -3150,7 +3150,7 @@ pub fn containing_shadow_root<T: DerivedFrom<Node> + DomObject>(
derived.upcast().containing_shadow_root()
}
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
pub fn stylesheets_owner_from_node<T: DerivedFrom<Node> + DomObject>(
derived: &T,
) -> StyleSheetListOwner {
diff --git a/components/script/dom/nodelist.rs b/components/script/dom/nodelist.rs
index 64140f98222..695a7a9f336 100644
--- a/components/script/dom/nodelist.rs
+++ b/components/script/dom/nodelist.rs
@@ -19,7 +19,7 @@ use crate::dom::node::{ChildrenMutation, Node};
use crate::dom::window::Window;
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub enum NodeListType {
Simple(Vec<Dom<Node>>),
Children(ChildrenList),
@@ -36,7 +36,7 @@ pub struct NodeList {
}
impl NodeList {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(list_type: NodeListType) -> NodeList {
NodeList {
reflector_: Reflector::new(),
@@ -44,7 +44,7 @@ impl NodeList {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(window: &Window, list_type: NodeListType) -> DomRoot<NodeList> {
reflect_dom_object(Box::new(NodeList::new_inherited(list_type)), window)
}
@@ -147,7 +147,7 @@ impl NodeList {
}
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct ChildrenList {
node: Dom<Node>,
#[ignore_malloc_size_of = "Defined in rust-mozjs"]
@@ -357,7 +357,7 @@ impl ChildrenList {
// and it's possible that tracking label moves would end up no faster
// than recalculating labels.
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct LabelsList {
element: Dom<HTMLElement>,
}
@@ -390,7 +390,7 @@ pub enum RadioListMode {
}
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct RadioList {
form: Dom<HTMLFormElement>,
mode: RadioListMode,
@@ -417,7 +417,7 @@ impl RadioList {
}
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct ElementsByNameList {
document: Dom<Document>,
name: DOMString,
diff --git a/components/script/dom/offlineaudiocontext.rs b/components/script/dom/offlineaudiocontext.rs
index c89cf82c5e7..b803a65dc8b 100644
--- a/components/script/dom/offlineaudiocontext.rs
+++ b/components/script/dom/offlineaudiocontext.rs
@@ -45,7 +45,7 @@ pub struct OfflineAudioContext {
#[allow(non_snake_case)]
impl OfflineAudioContext {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(
channel_count: u32,
length: u32,
@@ -70,7 +70,7 @@ impl OfflineAudioContext {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/offscreencanvas.rs b/components/script/dom/offscreencanvas.rs
index 9f1ce7333b6..9a364b3391f 100644
--- a/components/script/dom/offscreencanvas.rs
+++ b/components/script/dom/offscreencanvas.rs
@@ -25,7 +25,7 @@ use crate::dom::htmlcanvaselement::HTMLCanvasElement;
use crate::dom::offscreencanvasrenderingcontext2d::OffscreenCanvasRenderingContext2D;
use crate::script_runtime::JSContext;
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(Clone, JSTraceable, MallocSizeOf)]
pub enum OffscreenCanvasContext {
OffscreenContext2d(Dom<OffscreenCanvasRenderingContext2D>),
diff --git a/components/script/dom/offscreencanvasrenderingcontext2d.rs b/components/script/dom/offscreencanvasrenderingcontext2d.rs
index adf38225c98..97648281afb 100644
--- a/components/script/dom/offscreencanvasrenderingcontext2d.rs
+++ b/components/script/dom/offscreencanvasrenderingcontext2d.rs
@@ -207,7 +207,7 @@ impl OffscreenCanvasRenderingContext2DMethods for OffscreenCanvasRenderingContex
self.canvas_state.save()
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
// https://html.spec.whatwg.org/multipage/#dom-context-2d-restore
fn Restore(&self) {
self.canvas_state.restore()
diff --git a/components/script/dom/oscillatornode.rs b/components/script/dom/oscillatornode.rs
index 15d6c875b1d..6037cc779bd 100644
--- a/components/script/dom/oscillatornode.rs
+++ b/components/script/dom/oscillatornode.rs
@@ -38,7 +38,7 @@ pub struct OscillatorNode {
}
impl OscillatorNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
window: &Window,
context: &BaseAudioContext,
@@ -92,7 +92,7 @@ impl OscillatorNode {
Self::new_with_proto(window, None, context, options)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/paintworkletglobalscope.rs b/components/script/dom/paintworkletglobalscope.rs
index bfd67470b19..c93abc04711 100644
--- a/components/script/dom/paintworkletglobalscope.rs
+++ b/components/script/dom/paintworkletglobalscope.rs
@@ -463,7 +463,7 @@ pub enum PaintWorkletTask {
/// This type is dangerous, because it contains uboxed `Heap<JSVal>` values,
/// which can't be moved.
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
struct PaintDefinition {
#[ignore_malloc_size_of = "mozjs"]
class_constructor: Heap<JSVal>,
@@ -503,7 +503,7 @@ impl PaintDefinition {
impl PaintWorkletGlobalScopeMethods for PaintWorkletGlobalScope {
#[allow(unsafe_code)]
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
/// <https://drafts.css-houdini.org/css-paint-api/#dom-paintworkletglobalscope-registerpaint>
fn RegisterPaint(&self, name: DOMString, paint_ctor: Rc<VoidFunction>) -> Fallible<()> {
let name = Atom::from(name);
diff --git a/components/script/dom/pannernode.rs b/components/script/dom/pannernode.rs
index 3a617e50e70..4517bd1cf31 100644
--- a/components/script/dom/pannernode.rs
+++ b/components/script/dom/pannernode.rs
@@ -56,7 +56,7 @@ pub struct PannerNode {
}
impl PannerNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
window: &Window,
context: &BaseAudioContext,
@@ -181,7 +181,7 @@ impl PannerNode {
Self::new_with_proto(window, None, context, options)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/performanceentry.rs b/components/script/dom/performanceentry.rs
index 326cc7f4311..2056a8daf99 100644
--- a/components/script/dom/performanceentry.rs
+++ b/components/script/dom/performanceentry.rs
@@ -37,7 +37,7 @@ impl PerformanceEntry {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
global: &GlobalScope,
name: DOMString,
diff --git a/components/script/dom/performanceobserver.rs b/components/script/dom/performanceobserver.rs
index 067dd19a32a..cda2248f3e8 100644
--- a/components/script/dom/performanceobserver.rs
+++ b/components/script/dom/performanceobserver.rs
@@ -74,7 +74,7 @@ impl PerformanceObserver {
Self::new_with_proto(global, None, callback, entries)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,
diff --git a/components/script/dom/performanceobserverentrylist.rs b/components/script/dom/performanceobserverentrylist.rs
index 913592b5ed4..12a38d0515a 100644
--- a/components/script/dom/performanceobserverentrylist.rs
+++ b/components/script/dom/performanceobserverentrylist.rs
@@ -27,7 +27,7 @@ impl PerformanceObserverEntryList {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
global: &GlobalScope,
entries: PerformanceEntryList,
diff --git a/components/script/dom/performancepainttiming.rs b/components/script/dom/performancepainttiming.rs
index a18a962b952..69fa440d744 100644
--- a/components/script/dom/performancepainttiming.rs
+++ b/components/script/dom/performancepainttiming.rs
@@ -39,7 +39,7 @@ impl PerformancePaintTiming {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
global: &GlobalScope,
metric_type: ProgressiveWebMetricType,
diff --git a/components/script/dom/performanceresourcetiming.rs b/components/script/dom/performanceresourcetiming.rs
index 4146528f185..be1773aa9ca 100644
--- a/components/script/dom/performanceresourcetiming.rs
+++ b/components/script/dom/performanceresourcetiming.rs
@@ -101,7 +101,7 @@ impl PerformanceResourceTiming {
}
//TODO fetch start should be in RFT
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn from_resource_timing(
url: ServoUrl,
initiator_type: InitiatorType,
diff --git a/components/script/dom/performancetiming.rs b/components/script/dom/performancetiming.rs
index 9f8a3a8b5f2..b3c2ee426d8 100644
--- a/components/script/dom/performancetiming.rs
+++ b/components/script/dom/performancetiming.rs
@@ -33,7 +33,7 @@ impl PerformanceTiming {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
navigation_start: u64,
diff --git a/components/script/dom/promise.rs b/components/script/dom/promise.rs
index ce84609f79a..b0274ebeb2a 100644
--- a/components/script/dom/promise.rs
+++ b/components/script/dom/promise.rs
@@ -42,7 +42,7 @@ use crate::script_runtime::JSContext as SafeJSContext;
use crate::script_thread::ScriptThread;
#[dom_struct]
-#[unrooted_must_root_lint::allow_unrooted_in_rc]
+#[crown::unrooted_must_root_lint::allow_unrooted_in_rc]
pub struct Promise {
reflector: Reflector,
/// Since Promise values are natively reference counted without the knowledge of
@@ -106,7 +106,7 @@ impl Promise {
Promise::new_with_js_promise(self.reflector().get_jsobject(), cx)
}
- #[allow(unsafe_code, unrooted_must_root)]
+ #[allow(unsafe_code, crown::unrooted_must_root)]
pub fn new_with_js_promise(obj: HandleObject, cx: SafeJSContext) -> Rc<Promise> {
unsafe {
assert!(IsPromiseObject(obj));
@@ -145,7 +145,7 @@ impl Promise {
}
}
- #[allow(unrooted_must_root, unsafe_code)]
+ #[allow(crown::unrooted_must_root, unsafe_code)]
pub fn new_resolved(
global: &GlobalScope,
cx: SafeJSContext,
@@ -157,7 +157,7 @@ impl Promise {
Ok(Promise::new_with_js_promise(p.handle(), cx))
}
- #[allow(unrooted_must_root, unsafe_code)]
+ #[allow(crown::unrooted_must_root, unsafe_code)]
pub fn new_rejected(
global: &GlobalScope,
cx: SafeJSContext,
@@ -183,7 +183,7 @@ impl Promise {
self.resolve(cx, v.handle());
}
- #[allow(unrooted_must_root, unsafe_code)]
+ #[allow(crown::unrooted_must_root, unsafe_code)]
pub fn resolve(&self, cx: SafeJSContext, value: HandleValue) {
unsafe {
if !ResolvePromise(*cx, self.promise_obj(), value) {
@@ -217,7 +217,7 @@ impl Promise {
self.reject(cx, v.handle());
}
- #[allow(unrooted_must_root, unsafe_code)]
+ #[allow(crown::unrooted_must_root, unsafe_code)]
pub fn reject(&self, cx: SafeJSContext, value: HandleValue) {
unsafe {
if !RejectPromise(*cx, self.promise_obj(), value) {
diff --git a/components/script/dom/promiserejectionevent.rs b/components/script/dom/promiserejectionevent.rs
index 334ed691b0a..64e548493f2 100644
--- a/components/script/dom/promiserejectionevent.rs
+++ b/components/script/dom/promiserejectionevent.rs
@@ -34,7 +34,7 @@ pub struct PromiseRejectionEvent {
}
impl PromiseRejectionEvent {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(promise: Rc<Promise>) -> Self {
PromiseRejectionEvent {
event: Event::new_inherited(),
@@ -54,7 +54,7 @@ impl PromiseRejectionEvent {
Self::new_with_proto(global, None, type_, bubbles, cancelable, promise, reason)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,
@@ -79,7 +79,7 @@ impl PromiseRejectionEvent {
ev
}
- #[allow(unrooted_must_root, non_snake_case)]
+ #[allow(crown::unrooted_must_root, non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
proto: Option<HandleObject>,
diff --git a/components/script/dom/radionodelist.rs b/components/script/dom/radionodelist.rs
index 9ada855850a..e5257d8a770 100644
--- a/components/script/dom/radionodelist.rs
+++ b/components/script/dom/radionodelist.rs
@@ -24,14 +24,14 @@ pub struct RadioNodeList {
}
impl RadioNodeList {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(list_type: NodeListType) -> RadioNodeList {
RadioNodeList {
node_list: NodeList::new_inherited(list_type),
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(window: &Window, list_type: NodeListType) -> DomRoot<RadioNodeList> {
reflect_dom_object(Box::new(RadioNodeList::new_inherited(list_type)), window)
}
diff --git a/components/script/dom/range.rs b/components/script/dom/range.rs
index 9e25ab29016..7172e2c501e 100644
--- a/components/script/dom/range.rs
+++ b/components/script/dom/range.rs
@@ -1064,7 +1064,7 @@ impl RangeMethods for Range {
}
#[derive(DenyPublicFields, JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct BoundaryPoint {
node: MutDom<Node>,
offset: Cell<u32>,
@@ -1090,7 +1090,7 @@ impl BoundaryPoint {
}
}
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
impl PartialOrd for BoundaryPoint {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
bp_position(
@@ -1102,7 +1102,7 @@ impl PartialOrd for BoundaryPoint {
}
}
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
impl PartialEq for BoundaryPoint {
fn eq(&self, other: &Self) -> bool {
self.node.get() == other.node.get() && self.offset.get() == other.offset.get()
diff --git a/components/script/dom/raredata.rs b/components/script/dom/raredata.rs
index 54f46250530..1354637d7ae 100644
--- a/components/script/dom/raredata.rs
+++ b/components/script/dom/raredata.rs
@@ -20,7 +20,7 @@ use crate::dom::window::LayoutValue;
// storage.
#[derive(Default, JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct NodeRareData {
/// The shadow root the node belongs to.
/// This is None if the node is not in a shadow tree or
@@ -33,7 +33,7 @@ pub struct NodeRareData {
}
#[derive(Default, JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct ElementRareData {
/// https://dom.spec.whatwg.org/#dom-element-shadowroot
/// The ShadowRoot this element is host of.
diff --git a/components/script/dom/response.rs b/components/script/dom/response.rs
index 068729c9509..0d43077495a 100644
--- a/components/script/dom/response.rs
+++ b/components/script/dom/response.rs
@@ -455,7 +455,7 @@ impl Response {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn finish(&self) {
if let Some(body) = self.body_stream.get() {
body.close_native();
diff --git a/components/script/dom/rtcdatachannel.rs b/components/script/dom/rtcdatachannel.rs
index 50be50a573b..57fb1eba868 100644
--- a/components/script/dom/rtcdatachannel.rs
+++ b/components/script/dom/rtcdatachannel.rs
@@ -53,7 +53,7 @@ pub struct RTCDataChannel {
}
impl RTCDataChannel {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
peer_connection: &RTCPeerConnection,
label: USVString,
diff --git a/components/script/dom/rtctrackevent.rs b/components/script/dom/rtctrackevent.rs
index b055cb5bc4a..c6a5aefd67e 100644
--- a/components/script/dom/rtctrackevent.rs
+++ b/components/script/dom/rtctrackevent.rs
@@ -25,7 +25,7 @@ pub struct RTCTrackEvent {
}
impl RTCTrackEvent {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(track: &MediaStreamTrack) -> RTCTrackEvent {
RTCTrackEvent {
event: Event::new_inherited(),
diff --git a/components/script/dom/serviceworker.rs b/components/script/dom/serviceworker.rs
index 021192a95fa..7e456265e95 100644
--- a/components/script/dom/serviceworker.rs
+++ b/components/script/dom/serviceworker.rs
@@ -165,7 +165,7 @@ impl ServiceWorkerMethods for ServiceWorker {
}
impl TaskOnce for SimpleWorkerErrorHandler<ServiceWorker> {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn run_once(self) {
ServiceWorker::dispatch_simple_error(self.addr);
}
diff --git a/components/script/dom/serviceworkercontainer.rs b/components/script/dom/serviceworkercontainer.rs
index f1a76b58493..7812e91cd8e 100644
--- a/components/script/dom/serviceworkercontainer.rs
+++ b/components/script/dom/serviceworkercontainer.rs
@@ -45,7 +45,7 @@ impl ServiceWorkerContainer {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(global: &GlobalScope) -> DomRoot<ServiceWorkerContainer> {
let client = Client::new(&global.as_window());
let container = ServiceWorkerContainer::new_inherited(&*client);
diff --git a/components/script/dom/serviceworkerregistration.rs b/components/script/dom/serviceworkerregistration.rs
index 6134979343b..5c5969f42a6 100644
--- a/components/script/dom/serviceworkerregistration.rs
+++ b/components/script/dom/serviceworkerregistration.rs
@@ -61,7 +61,7 @@ impl ServiceWorkerRegistration {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
global: &GlobalScope,
scope: ServoUrl,
diff --git a/components/script/dom/servoparser/async_html.rs b/components/script/dom/servoparser/async_html.rs
index 08e3238754b..2e24623e264 100644
--- a/components/script/dom/servoparser/async_html.rs
+++ b/components/script/dom/servoparser/async_html.rs
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-#![allow(unrooted_must_root)]
+#![allow(crown::unrooted_must_root)]
use std::borrow::Cow;
use std::cell::Cell;
@@ -204,7 +204,7 @@ fn create_buffer_queue(mut buffers: VecDeque<SendTendril<UTF8>>) -> BufferQueue
// |_____________| |_______________|
//
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct Tokenizer {
document: Dom<Document>,
#[ignore_malloc_size_of = "Defined in std"]
@@ -668,7 +668,7 @@ impl Sink {
}
}
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
impl TreeSink for Sink {
type Output = Self;
fn finish(self) -> Self {
diff --git a/components/script/dom/servoparser/html.rs b/components/script/dom/servoparser/html.rs
index cb98ca785a0..fdca7ca58fa 100644
--- a/components/script/dom/servoparser/html.rs
+++ b/components/script/dom/servoparser/html.rs
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-#![allow(unrooted_must_root)]
+#![allow(crown::unrooted_must_root)]
use std::io;
@@ -31,7 +31,7 @@ use crate::dom::processinginstruction::ProcessingInstruction;
use crate::dom::servoparser::{ParsingAlgorithm, Sink};
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct Tokenizer {
#[ignore_malloc_size_of = "Defined in html5ever"]
inner: HtmlTokenizer<TreeBuilder<Dom<Node>, Sink>>,
@@ -109,7 +109,7 @@ unsafe impl CustomTraceable for HtmlTokenizer<TreeBuilder<Dom<Node>, Sink>> {
impl HtmlTracer for Tracer {
type Handle = Dom<Node>;
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn trace_handle(&self, node: &Dom<Node>) {
unsafe {
node.trace(self.0);
diff --git a/components/script/dom/servoparser/mod.rs b/components/script/dom/servoparser/mod.rs
index a21bec9b8c6..632a0442548 100644
--- a/components/script/dom/servoparser/mod.rs
+++ b/components/script/dom/servoparser/mod.rs
@@ -422,7 +422,7 @@ impl ServoParser {
self.script_nesting_level() > 0 && !self.aborted.get()
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(
document: &Document,
tokenizer: Tokenizer,
@@ -447,7 +447,7 @@ impl ServoParser {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new(
document: &Document,
tokenizer: Tokenizer,
@@ -693,7 +693,7 @@ enum ParserKind {
}
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
enum Tokenizer {
Html(self::html::Tokenizer),
AsyncHtml(self::async_html::Tokenizer),
@@ -1023,7 +1023,7 @@ pub struct FragmentContext<'a> {
pub form_elem: Option<&'a Node>,
}
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
fn insert(
parent: &Node,
reference_child: Option<&Node>,
@@ -1063,7 +1063,7 @@ fn insert(
}
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct Sink {
#[no_trace]
base_url: ServoUrl,
@@ -1086,7 +1086,7 @@ impl Sink {
}
}
-#[allow(unrooted_must_root)] // FIXME: really?
+#[allow(crown::unrooted_must_root)] // FIXME: really?
impl TreeSink for Sink {
type Output = Self;
fn finish(self) -> Self {
diff --git a/components/script/dom/servoparser/prefetch.rs b/components/script/dom/servoparser/prefetch.rs
index 65c103e66df..7ccca449d15 100644
--- a/components/script/dom/servoparser/prefetch.rs
+++ b/components/script/dom/servoparser/prefetch.rs
@@ -23,7 +23,7 @@ use crate::script_module::ScriptFetchOptions;
use crate::stylesheet_loader::stylesheet_fetch_request;
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct Tokenizer {
#[ignore_malloc_size_of = "Defined in html5ever"]
inner: HtmlTokenizer<PrefetchSink>,
diff --git a/components/script/dom/servoparser/xml.rs b/components/script/dom/servoparser/xml.rs
index 583c90fba61..d07d6bc6afb 100644
--- a/components/script/dom/servoparser/xml.rs
+++ b/components/script/dom/servoparser/xml.rs
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-#![allow(unrooted_must_root)]
+#![allow(crown::unrooted_must_root)]
use html5ever::tokenizer::TokenizerResult;
use js::jsapi::JSTracer;
@@ -19,7 +19,7 @@ use crate::dom::node::Node;
use crate::dom::servoparser::{ParsingAlgorithm, Sink};
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct Tokenizer {
#[ignore_malloc_size_of = "Defined in xml5ever"]
inner: XmlTokenizer<XmlTreeBuilder<Dom<Node>, Sink>>,
@@ -67,7 +67,7 @@ unsafe impl CustomTraceable for XmlTokenizer<XmlTreeBuilder<Dom<Node>, Sink>> {
impl XmlTracer for Tracer {
type Handle = Dom<Node>;
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn trace_handle(&self, node: &Dom<Node>) {
unsafe {
node.trace(self.0);
diff --git a/components/script/dom/shadowroot.rs b/components/script/dom/shadowroot.rs
index 168a4ec0a32..2c9e56d8352 100644
--- a/components/script/dom/shadowroot.rs
+++ b/components/script/dom/shadowroot.rs
@@ -50,7 +50,7 @@ pub struct ShadowRoot {
}
impl ShadowRoot {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(host: &Element, document: &Document) -> ShadowRoot {
let document_fragment = DocumentFragment::new_inherited(document);
let node = document_fragment.upcast::<Node>();
@@ -104,7 +104,7 @@ impl ShadowRoot {
/// Add a stylesheet owned by `owner` to the list of shadow root sheets, in the
/// correct tree position.
- #[allow(unrooted_must_root)] // Owner needs to be rooted already necessarily.
+ #[allow(crown::unrooted_must_root)] // Owner needs to be rooted already necessarily.
pub fn add_stylesheet(&self, owner: &Element, sheet: Arc<Stylesheet>) {
let stylesheets = &mut self.author_styles.borrow_mut().stylesheets;
let insertion_point = stylesheets
@@ -125,7 +125,7 @@ impl ShadowRoot {
}
/// Remove a stylesheet owned by `owner` from the list of shadow root sheets.
- #[allow(unrooted_must_root)] // Owner needs to be rooted already necessarily.
+ #[allow(crown::unrooted_must_root)] // Owner needs to be rooted already necessarily.
pub fn remove_stylesheet(&self, owner: &Element, s: &Arc<Stylesheet>) {
DocumentOrShadowRoot::remove_stylesheet(
owner,
diff --git a/components/script/dom/stereopannernode.rs b/components/script/dom/stereopannernode.rs
index e8cd8701572..77761a49e42 100644
--- a/components/script/dom/stereopannernode.rs
+++ b/components/script/dom/stereopannernode.rs
@@ -30,7 +30,7 @@ pub struct StereoPannerNode {
}
impl StereoPannerNode {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
window: &Window,
context: &BaseAudioContext,
@@ -80,7 +80,7 @@ impl StereoPannerNode {
Self::new_with_proto(window, None, context, options)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/stylesheet.rs b/components/script/dom/stylesheet.rs
index d48356e4b92..48871356a5c 100644
--- a/components/script/dom/stylesheet.rs
+++ b/components/script/dom/stylesheet.rs
@@ -22,7 +22,7 @@ pub struct StyleSheet {
}
impl StyleSheet {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new_inherited(
type_: DOMString,
href: Option<DOMString>,
diff --git a/components/script/dom/stylesheetlist.rs b/components/script/dom/stylesheetlist.rs
index 4d561aa56fd..f430b905584 100644
--- a/components/script/dom/stylesheetlist.rs
+++ b/components/script/dom/stylesheetlist.rs
@@ -16,7 +16,7 @@ use crate::dom::shadowroot::ShadowRoot;
use crate::dom::stylesheet::StyleSheet;
use crate::dom::window::Window;
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(JSTraceable, MallocSizeOf)]
pub enum StyleSheetListOwner {
Document(Dom<Document>),
@@ -73,7 +73,7 @@ pub struct StyleSheetList {
}
impl StyleSheetList {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(doc_or_sr: StyleSheetListOwner) -> StyleSheetList {
StyleSheetList {
reflector_: Reflector::new(),
@@ -81,7 +81,7 @@ impl StyleSheetList {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(window: &Window, doc_or_sr: StyleSheetListOwner) -> DomRoot<StyleSheetList> {
reflect_dom_object(Box::new(StyleSheetList::new_inherited(doc_or_sr)), window)
}
diff --git a/components/script/dom/svgsvgelement.rs b/components/script/dom/svgsvgelement.rs
index 4240b3aa657..95782500fc8 100644
--- a/components/script/dom/svgsvgelement.rs
+++ b/components/script/dom/svgsvgelement.rs
@@ -37,7 +37,7 @@ impl SVGSVGElement {
}
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs
index 071bccdec75..5e2748ac692 100644
--- a/components/script/dom/testbinding.rs
+++ b/components/script/dom/testbinding.rs
@@ -953,12 +953,12 @@ impl TestBindingMethods for TestBinding {
Record::new()
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn ReturnResolvedPromise(&self, cx: SafeJSContext, v: HandleValue) -> Fallible<Rc<Promise>> {
Promise::new_resolved(&self.global(), cx, v)
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn ReturnRejectedPromise(&self, cx: SafeJSContext, v: HandleValue) -> Fallible<Rc<Promise>> {
Promise::new_rejected(&self.global(), cx, v)
}
@@ -975,7 +975,7 @@ impl TestBindingMethods for TestBinding {
p.reject_error(Error::Type(s.0));
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn ResolvePromiseDelayed(&self, p: &Promise, value: DOMString, delay: u64) {
let promise = p.duplicate();
let cb = TestBindingCallback {
@@ -1129,7 +1129,7 @@ pub struct TestBindingCallback {
}
impl TestBindingCallback {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn invoke(self) {
self.promise.root().resolve_native(&self.value);
}
diff --git a/components/script/dom/testbindingmaplike.rs b/components/script/dom/testbindingmaplike.rs
index 19dbcf9da8f..9e8157a05ad 100644
--- a/components/script/dom/testbindingmaplike.rs
+++ b/components/script/dom/testbindingmaplike.rs
@@ -81,7 +81,7 @@ impl TestBindingMaplikeMethods for TestBindingMaplike {
// this error is wrong because if we inline Self::Key and Self::Value all errors are gone
// TODO: FIX THIS
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
impl Maplike for TestBindingMaplike {
type Key = DOMString;
type Value = i32;
diff --git a/components/script/dom/testbindingsetlike.rs b/components/script/dom/testbindingsetlike.rs
index f39e8f69514..6e0530bcb81 100644
--- a/components/script/dom/testbindingsetlike.rs
+++ b/components/script/dom/testbindingsetlike.rs
@@ -55,7 +55,7 @@ impl TestBindingSetlikeMethods for TestBindingSetlike {
// this error is wrong because if we inline Self::Key and Self::Value all errors are gone
// TODO: FIX THIS
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
impl Setlike for TestBindingSetlike {
type Key = DOMString;
diff --git a/components/script/dom/trackevent.rs b/components/script/dom/trackevent.rs
index 35cf787fcba..ee1f72c67e5 100644
--- a/components/script/dom/trackevent.rs
+++ b/components/script/dom/trackevent.rs
@@ -22,7 +22,7 @@ use crate::dom::texttrack::TextTrack;
use crate::dom::videotrack::VideoTrack;
use crate::dom::window::Window;
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(JSTraceable, MallocSizeOf)]
enum MediaTrack {
Video(Dom<VideoTrack>),
@@ -38,7 +38,7 @@ pub struct TrackEvent {
#[allow(non_snake_case)]
impl TrackEvent {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(track: &Option<VideoTrackOrAudioTrackOrTextTrack>) -> TrackEvent {
let media_track = match track {
Some(VideoTrackOrAudioTrackOrTextTrack::VideoTrack(VideoTrack)) => {
diff --git a/components/script/dom/vertexarrayobject.rs b/components/script/dom/vertexarrayobject.rs
index 4021fe49e5f..a7f39cb7a46 100644
--- a/components/script/dom/vertexarrayobject.rs
+++ b/components/script/dom/vertexarrayobject.rs
@@ -16,7 +16,7 @@ use crate::dom::webglbuffer::WebGLBuffer;
use crate::dom::webglrenderingcontext::{Operation, WebGLRenderingContext};
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct VertexArrayObject {
context: Dom<WebGLRenderingContext>,
#[no_trace]
@@ -264,7 +264,7 @@ impl Drop for VertexArrayObject {
}
#[derive(Clone, JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct VertexAttribData {
pub enabled_as_array: bool,
pub size: u8,
@@ -278,7 +278,7 @@ pub struct VertexAttribData {
}
impl Default for VertexAttribData {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn default() -> Self {
Self {
enabled_as_array: false,
diff --git a/components/script/dom/webgl2renderingcontext.rs b/components/script/dom/webgl2renderingcontext.rs
index bca22a9931f..7882d018c1a 100644
--- a/components/script/dom/webgl2renderingcontext.rs
+++ b/components/script/dom/webgl2renderingcontext.rs
@@ -68,7 +68,7 @@ use crate::dom::window::Window;
use crate::js::conversions::ToJSValConvertible;
use crate::script_runtime::JSContext;
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(JSTraceable, MallocSizeOf)]
struct IndexedBinding {
buffer: MutNullableDom<WebGLBuffer>,
@@ -179,7 +179,7 @@ impl WebGL2RenderingContext {
})
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
canvas: &HTMLCanvasElement,
diff --git a/components/script/dom/webgl_extensions/extensions.rs b/components/script/dom/webgl_extensions/extensions.rs
index 4c1bf37d0e4..f6066cfd75f 100644
--- a/components/script/dom/webgl_extensions/extensions.rs
+++ b/components/script/dom/webgl_extensions/extensions.rs
@@ -164,7 +164,7 @@ impl WebGLExtensionFeatures {
}
/// Handles the list of implemented, supported and enabled WebGL extensions.
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(JSTraceable, MallocSizeOf)]
pub struct WebGLExtensions {
extensions: DomRefCell<HashMap<String, Box<dyn WebGLExtensionWrapper>>>,
diff --git a/components/script/dom/webgl_extensions/wrapper.rs b/components/script/dom/webgl_extensions/wrapper.rs
index 84338640835..d5fed25c9f3 100644
--- a/components/script/dom/webgl_extensions/wrapper.rs
+++ b/components/script/dom/webgl_extensions/wrapper.rs
@@ -30,7 +30,7 @@ pub trait WebGLExtensionWrapper: JSTraceable + MallocSizeOf {
fn as_any(&self) -> &dyn Any;
}
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(JSTraceable, MallocSizeOf)]
pub struct TypedWebGLExtensionWrapper<T: WebGLExtension> {
extension: MutNullableDom<T::Extension>,
diff --git a/components/script/dom/webglframebuffer.rs b/components/script/dom/webglframebuffer.rs
index 541795dc6ce..70cf84cdf11 100644
--- a/components/script/dom/webglframebuffer.rs
+++ b/components/script/dom/webglframebuffer.rs
@@ -34,7 +34,7 @@ fn log2(n: u32) -> u32 {
31 - n.leading_zeros()
}
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(Clone, JSTraceable, MallocSizeOf)]
enum WebGLFramebufferAttachment {
Renderbuffer(Dom<WebGLRenderbuffer>),
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index dc71cf3912a..aa782eb6788 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -282,7 +282,7 @@ impl WebGLRenderingContext {
})
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
pub fn new(
window: &Window,
canvas: &HTMLCanvasElement,
@@ -4746,7 +4746,7 @@ capabilities! {
STENCIL_TEST,
}
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(JSTraceable, MallocSizeOf)]
pub struct Textures {
active_unit: Cell<u32>,
@@ -4826,7 +4826,7 @@ impl Textures {
}
}
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(Default, JSTraceable, MallocSizeOf)]
struct TextureUnit {
tex_2d: MutNullableDom<WebGLTexture>,
diff --git a/components/script/dom/webgltexture.rs b/components/script/dom/webgltexture.rs
index ccae44da729..efce995d9b2 100644
--- a/components/script/dom/webgltexture.rs
+++ b/components/script/dom/webgltexture.rs
@@ -33,7 +33,7 @@ pub enum TexParameterValue {
// Textures generated for WebXR are owned by the WebXR device, not by the WebGL thread
// so the GL texture should not be deleted when the texture is garbage collected.
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(JSTraceable, MallocSizeOf)]
enum WebGLTextureOwner {
WebGL,
diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs
index 7899da4b471..94b248cef84 100644
--- a/components/script/dom/worker.rs
+++ b/components/script/dom/worker.rs
@@ -284,7 +284,7 @@ impl WorkerMethods for Worker {
}
impl TaskOnce for SimpleWorkerErrorHandler<Worker> {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn run_once(self) {
Worker::dispatch_simple_error(self.addr);
}
diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs
index eb9b200a935..561193cc2f2 100644
--- a/components/script/dom/workerglobalscope.rs
+++ b/components/script/dom/workerglobalscope.rs
@@ -398,7 +398,7 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
p
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
// https://fetch.spec.whatwg.org/#fetch-method
fn Fetch(
&self,
diff --git a/components/script/dom/worklet.rs b/components/script/dom/worklet.rs
index e3f94d8e6ce..b039fc12cd0 100644
--- a/components/script/dom/worklet.rs
+++ b/components/script/dom/worklet.rs
@@ -424,7 +424,7 @@ struct WorkletThreadInit {
}
/// A thread for executing worklets.
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
struct WorkletThread {
/// Which role the thread is currently playing
role: WorkletThreadRole,
@@ -463,7 +463,7 @@ unsafe impl JSTraceable for WorkletThread {
impl WorkletThread {
/// Spawn a new worklet thread, returning the channel to send it control messages.
#[allow(unsafe_code)]
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn spawn(role: WorkletThreadRole, init: WorkletThreadInit) -> Sender<WorkletControl> {
let (control_sender, control_receiver) = unbounded();
// TODO: name this thread
diff --git a/components/script/dom/xrinputsourceevent.rs b/components/script/dom/xrinputsourceevent.rs
index 6b7b41026fb..0c7844a42a1 100644
--- a/components/script/dom/xrinputsourceevent.rs
+++ b/components/script/dom/xrinputsourceevent.rs
@@ -29,7 +29,7 @@ pub struct XRInputSourceEvent {
}
impl XRInputSourceEvent {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(frame: &XRFrame, source: &XRInputSource) -> XRInputSourceEvent {
XRInputSourceEvent {
event: Event::new_inherited(),
diff --git a/components/script/dom/xrinputsourceschangeevent.rs b/components/script/dom/xrinputsourceschangeevent.rs
index 13f3790b957..ade0a977c51 100644
--- a/components/script/dom/xrinputsourceschangeevent.rs
+++ b/components/script/dom/xrinputsourceschangeevent.rs
@@ -36,7 +36,7 @@ pub struct XRInputSourcesChangeEvent {
}
impl XRInputSourcesChangeEvent {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(session: &XRSession) -> XRInputSourcesChangeEvent {
XRInputSourcesChangeEvent {
event: Event::new_inherited(),
diff --git a/components/script/dom/xrsessionevent.rs b/components/script/dom/xrsessionevent.rs
index 84f2d7215d8..67006bac434 100644
--- a/components/script/dom/xrsessionevent.rs
+++ b/components/script/dom/xrsessionevent.rs
@@ -25,7 +25,7 @@ pub struct XRSessionEvent {
}
impl XRSessionEvent {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn new_inherited(session: &XRSession) -> XRSessionEvent {
XRSessionEvent {
event: Event::new_inherited(),
diff --git a/components/script/fetch.rs b/components/script/fetch.rs
index 3e2af19f477..73872fbdf0d 100644
--- a/components/script/fetch.rs
+++ b/components/script/fetch.rs
@@ -136,7 +136,7 @@ fn request_init_from_request(request: NetTraitsRequest) -> RequestBuilder {
}
// https://fetch.spec.whatwg.org/#fetch-method
-#[allow(unrooted_must_root, non_snake_case)]
+#[allow(crown::unrooted_must_root, non_snake_case)]
pub fn Fetch(
global: &GlobalScope,
input: RequestInfo,
@@ -211,7 +211,7 @@ impl FetchResponseListener for FetchContext {
// TODO
}
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn process_response(&mut self, fetch_metadata: Result<FetchMetadata, NetworkError>) {
let promise = self
.fetch_promise
diff --git a/components/script/lib.rs b/components/script/lib.rs
index 0e652d0be5b..5333f5ea1b5 100644
--- a/components/script/lib.rs
+++ b/components/script/lib.rs
@@ -7,17 +7,10 @@
#![feature(register_tool)]
#![deny(unsafe_code)]
#![doc = "The script crate contains all matters DOM."]
-#![cfg_attr(
- not(any(
- feature = "unrooted_must_root_lint",
- feature = "trace_in_no_trace_lint"
- )),
- allow(unknown_lints)
-)]
-#![allow(deprecated)] // FIXME: Can we make `allow` only apply to the `plugin` crate attribute?
-#![plugin(script_plugins)]
-#![register_tool(unrooted_must_root_lint)]
-#![register_tool(trace_in_no_trace_lint)]
+#![register_tool(crown)]
+// Issue a warning if `crown` cannot be found.
+#![warn(unknown_lints)]
+#![deny(crown_is_not_used)]
// These are used a lot so let's keep them for now
#[macro_use]
diff --git a/components/script/script_module.rs b/components/script/script_module.rs
index 5dfe8975108..4a3da79454a 100644
--- a/components/script/script_module.rs
+++ b/components/script/script_module.rs
@@ -1498,7 +1498,7 @@ pub(crate) fn fetch_external_module_script(
}
#[derive(JSTraceable, MallocSizeOf)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub(crate) struct DynamicModuleList {
requests: Vec<RootedTraceableBox<DynamicModule>>,
@@ -1532,7 +1532,7 @@ impl DynamicModuleList {
}
}
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
#[derive(JSTraceable, MallocSizeOf)]
struct DynamicModule {
#[ignore_malloc_size_of = "Rc is hard"]
diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs
index a93dbd5bbf8..45e8b9aa716 100644
--- a/components/script/script_runtime.rs
+++ b/components/script/script_runtime.rs
@@ -233,7 +233,7 @@ unsafe extern "C" fn enqueue_promise_job(
result
}
-#[allow(unsafe_code, unrooted_must_root)]
+#[allow(unsafe_code, crown::unrooted_must_root)]
/// https://html.spec.whatwg.org/multipage/#the-hostpromiserejectiontracker-implementation
unsafe extern "C" fn promise_rejection_tracker(
cx: *mut RawJSContext,
@@ -311,7 +311,7 @@ unsafe extern "C" fn promise_rejection_tracker(
})
}
-#[allow(unsafe_code, unrooted_must_root)]
+#[allow(unsafe_code, crown::unrooted_must_root)]
/// https://html.spec.whatwg.org/multipage/#notify-about-rejected-promises
pub fn notify_about_rejected_promises(global: &GlobalScope) {
let cx = GlobalScope::get_cx();
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index b33eb922fd8..25f47f3a440 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -442,7 +442,7 @@ impl OpaqueSender<CommonScriptMsg> for Sender<MainThreadScriptMsg> {
/// The set of all documents managed by this script thread.
#[derive(JSTraceable)]
-#[unrooted_must_root_lint::must_root]
+#[crown::unrooted_must_root_lint::must_root]
pub struct Documents {
map: HashMapTracedValues<PipelineId, Dom<Document>>,
}
@@ -496,7 +496,7 @@ impl Documents {
}
}
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
pub struct DocumentsIter<'a> {
iter: hash_map::Iter<'a, PipelineId, Dom<Document>>,
}
@@ -522,7 +522,7 @@ unsafe_no_jsmanaged_fields!(TaskQueue<MainThreadScriptMsg>);
#[derive(JSTraceable)]
// ScriptThread instances are rooted on creation, so this is okay
-#[allow(unrooted_must_root)]
+#[allow(crown::unrooted_must_root)]
pub struct ScriptThread {
/// The documents for pipelines managed by this thread
documents: DomRefCell<Documents>,
@@ -771,7 +771,7 @@ impl<'a> ScriptMemoryFailsafe<'a> {
}
impl<'a> Drop for ScriptMemoryFailsafe<'a> {
- #[allow(unrooted_must_root)]
+ #[allow(crown::unrooted_must_root)]
fn drop(&mut self) {
if let Some(owner) = self.owner {
for (_, document) in owner.documents.borrow().iter() {
diff --git a/components/script_plugins/Cargo.toml b/components/script_plugins/Cargo.toml
deleted file mode 100644
index b5a4d6f43f1..00000000000
--- a/components/script_plugins/Cargo.toml
+++ /dev/null
@@ -1,18 +0,0 @@
-[package]
-name = "script_plugins"
-version = "0.0.1"
-authors = ["The Servo Project Developers"]
-license = "MPL-2.0"
-edition = "2018"
-publish = false
-
-[lib]
-path = "lib.rs"
-plugin = true
-
-[features]
-unrooted_must_root_lint = []
-trace_in_no_trace_lint = []
-
-[package.metadata.rust-analyzer]
-rustc_private = true
diff --git a/components/script_plugins/lib.rs b/components/script_plugins/lib.rs
deleted file mode 100644
index de1ee5f7e53..00000000000
--- a/components/script_plugins/lib.rs
+++ /dev/null
@@ -1,349 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-
-//! Servo's compiler plugin/macro crate
-//!
-//! This crate provides the `#[unrooted_must_root_lint::must_root]` lint. This lint prevents data
-//! of the marked type from being used on the stack. See the source for more details.
-
-#![deny(unsafe_code)]
-#![feature(plugin)]
-#![feature(rustc_private)]
-
-// This rustc crate is private so it needs to be manually imported.
-extern crate rustc_ast;
-extern crate rustc_driver;
-extern crate rustc_error_messages;
-extern crate rustc_hir;
-extern crate rustc_infer;
-extern crate rustc_lint;
-extern crate rustc_middle;
-extern crate rustc_session;
-extern crate rustc_span;
-extern crate rustc_trait_selection;
-extern crate rustc_type_ir;
-
-use rustc_ast::Mutability;
-use rustc_driver::plugin::Registry;
-use rustc_hir::def::{DefKind, Res};
-use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
-use rustc_hir::{ImplItemRef, ItemKind, Node, OwnerId, PrimTy, TraitItemRef};
-use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
-use rustc_infer::infer::TyCtxtInferExt;
-use rustc_lint::LateContext;
-use rustc_middle::ty::{self, GenericArg, ParamEnv, Ty, TyCtxt, TypeVisitableExt};
-use rustc_span::source_map::{ExpnKind, MacroKind, Span};
-use rustc_span::symbol::{Ident, Symbol};
-use rustc_span::DUMMY_SP;
-use rustc_trait_selection::infer::InferCtxtExt;
-use rustc_type_ir::{FloatTy, IntTy, UintTy};
-
-#[cfg(feature = "unrooted_must_root_lint")]
-mod unrooted_must_root;
-
-#[cfg(feature = "trace_in_no_trace_lint")]
-mod trace_in_no_trace;
-
-#[allow(unsafe_code)] // #[no_mangle] is unsafe
-#[no_mangle]
-fn __rustc_plugin_registrar(reg: &mut Registry) {
- #[cfg(feature = "unrooted_must_root_lint")]
- unrooted_must_root::register(reg);
- #[cfg(feature = "trace_in_no_trace_lint")]
- trace_in_no_trace::register(reg);
-}
-
-/// check if a DefId's path matches the given absolute type path
-/// usage e.g. with
-/// `match_def_path(cx, id, &["core", "option", "Option"])`
-fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool {
- let def_path = cx.tcx.def_path(def_id);
- let krate = &cx.tcx.crate_name(def_path.krate);
- if krate != &path[0] {
- return false;
- }
-
- let path = &path[1..];
- let other = def_path.data;
-
- if other.len() != path.len() {
- return false;
- }
-
- other
- .into_iter()
- .zip(path)
- .all(|(e, p)| e.data.get_opt_name().as_ref() == Some(p))
-}
-
-fn in_derive_expn(span: Span) -> bool {
- matches!(
- span.ctxt().outer_expn_data().kind,
- ExpnKind::Macro(MacroKind::Derive, ..)
- )
-}
-
-#[macro_export]
-macro_rules! symbols {
- ($($s: ident)+) => {
- #[derive(Clone)]
- #[allow(non_snake_case)]
- pub(crate) struct Symbols {
- $( $s: Symbol, )+
- }
-
- impl Symbols {
- fn new() -> Self {
- Symbols {
- $( $s: Symbol::intern(stringify!($s)), )+
- }
- }
- }
- }
-}
-
-/*
-Stuff copied from clippy:
-*/
-
-fn find_primitive_impls<'tcx>(tcx: TyCtxt<'tcx>, name: &str) -> impl Iterator<Item = DefId> + 'tcx {
- use rustc_middle::ty::fast_reject::SimplifiedType::*;
- let ty = match name {
- "bool" => BoolSimplifiedType,
- "char" => CharSimplifiedType,
- "str" => StrSimplifiedType,
- "array" => ArraySimplifiedType,
- "slice" => SliceSimplifiedType,
- // FIXME: rustdoc documents these two using just `pointer`.
- //
- // Maybe this is something we should do here too.
- "const_ptr" => PtrSimplifiedType(Mutability::Not),
- "mut_ptr" => PtrSimplifiedType(Mutability::Mut),
- "isize" => IntSimplifiedType(IntTy::Isize),
- "i8" => IntSimplifiedType(IntTy::I8),
- "i16" => IntSimplifiedType(IntTy::I16),
- "i32" => IntSimplifiedType(IntTy::I32),
- "i64" => IntSimplifiedType(IntTy::I64),
- "i128" => IntSimplifiedType(IntTy::I128),
- "usize" => UintSimplifiedType(UintTy::Usize),
- "u8" => UintSimplifiedType(UintTy::U8),
- "u16" => UintSimplifiedType(UintTy::U16),
- "u32" => UintSimplifiedType(UintTy::U32),
- "u64" => UintSimplifiedType(UintTy::U64),
- "u128" => UintSimplifiedType(UintTy::U128),
- "f32" => FloatSimplifiedType(FloatTy::F32),
- "f64" => FloatSimplifiedType(FloatTy::F64),
- _ => return [].iter().copied(),
- };
-
- tcx.incoherent_impls(ty).iter().copied()
-}
-
-fn non_local_item_children_by_name(tcx: TyCtxt<'_>, def_id: DefId, name: Symbol) -> Vec<Res> {
- match tcx.def_kind(def_id) {
- DefKind::Mod | DefKind::Enum | DefKind::Trait => tcx
- .module_children(def_id)
- .iter()
- .filter(|item| item.ident.name == name)
- .map(|child| child.res.expect_non_local())
- .collect(),
- DefKind::Impl { .. } => tcx
- .associated_item_def_ids(def_id)
- .iter()
- .copied()
- .filter(|assoc_def_id| tcx.item_name(*assoc_def_id) == name)
- .map(|assoc_def_id| Res::Def(tcx.def_kind(assoc_def_id), assoc_def_id))
- .collect(),
- _ => Vec::new(),
- }
-}
-
-fn local_item_children_by_name(tcx: TyCtxt<'_>, local_id: LocalDefId, name: Symbol) -> Vec<Res> {
- let hir = tcx.hir();
-
- let root_mod;
- let item_kind = match hir.find_by_def_id(local_id) {
- Some(Node::Crate(r#mod)) => {
- root_mod = ItemKind::Mod(r#mod);
- &root_mod
- },
- Some(Node::Item(item)) => &item.kind,
- _ => return Vec::new(),
- };
-
- let res = |ident: Ident, owner_id: OwnerId| {
- if ident.name == name {
- let def_id = owner_id.to_def_id();
- Some(Res::Def(tcx.def_kind(def_id), def_id))
- } else {
- None
- }
- };
-
- match item_kind {
- ItemKind::Mod(r#mod) => r#mod
- .item_ids
- .iter()
- .filter_map(|&item_id| res(hir.item(item_id).ident, item_id.owner_id))
- .collect(),
- ItemKind::Impl(r#impl) => r#impl
- .items
- .iter()
- .filter_map(|&ImplItemRef { ident, id, .. }| res(ident, id.owner_id))
- .collect(),
- ItemKind::Trait(.., trait_item_refs) => trait_item_refs
- .iter()
- .filter_map(|&TraitItemRef { ident, id, .. }| res(ident, id.owner_id))
- .collect(),
- _ => Vec::new(),
- }
-}
-
-fn item_children_by_name(tcx: TyCtxt<'_>, def_id: DefId, name: Symbol) -> Vec<Res> {
- if let Some(local_id) = def_id.as_local() {
- local_item_children_by_name(tcx, local_id, name)
- } else {
- non_local_item_children_by_name(tcx, def_id, name)
- }
-}
-
-/// Resolves a def path like `std::vec::Vec`.
-///
-/// Can return multiple resolutions when there are multiple versions of the same crate, e.g.
-/// `memchr::memchr` could return the functions from both memchr 1.0 and memchr 2.0.
-///
-/// Also returns multiple results when there are multiple paths under the same name e.g. `std::vec`
-/// would have both a [`DefKind::Mod`] and [`DefKind::Macro`].
-///
-/// This function is expensive and should be used sparingly.
-pub fn def_path_res(cx: &LateContext<'_>, path: &[&str]) -> Vec<Res> {
- fn find_crates(tcx: TyCtxt<'_>, name: Symbol) -> impl Iterator<Item = DefId> + '_ {
- tcx.crates(())
- .iter()
- .copied()
- .filter(move |&num| tcx.crate_name(num) == name)
- .map(CrateNum::as_def_id)
- }
-
- let tcx = cx.tcx;
-
- let (base, mut path) = match *path {
- [primitive] => {
- return vec![PrimTy::from_name(Symbol::intern(primitive)).map_or(Res::Err, Res::PrimTy)];
- },
- [base, ref path @ ..] => (base, path),
- _ => return Vec::new(),
- };
-
- let base_sym = Symbol::intern(base);
-
- let local_crate = if tcx.crate_name(LOCAL_CRATE) == base_sym {
- Some(LOCAL_CRATE.as_def_id())
- } else {
- None
- };
-
- let starts = find_primitive_impls(tcx, base)
- .chain(find_crates(tcx, base_sym))
- .chain(local_crate)
- .map(|id| Res::Def(tcx.def_kind(id), id));
-
- let mut resolutions: Vec<Res> = starts.collect();
-
- while let [segment, rest @ ..] = path {
- path = rest;
- let segment = Symbol::intern(segment);
-
- resolutions = resolutions
- .into_iter()
- .filter_map(|res| res.opt_def_id())
- .flat_map(|def_id| {
- // When the current def_id is e.g. `struct S`, check the impl items in
- // `impl S { ... }`
- let inherent_impl_children = tcx
- .inherent_impls(def_id)
- .iter()
- .flat_map(|&impl_def_id| item_children_by_name(tcx, impl_def_id, segment));
-
- let direct_children = item_children_by_name(tcx, def_id, segment);
-
- inherent_impl_children.chain(direct_children)
- })
- .collect();
- }
-
- resolutions
-}
-
-/// Resolves a def path like `std::vec::Vec` to its [`DefId`]s, see [`def_path_res`].
-pub fn def_path_def_ids(cx: &LateContext<'_>, path: &[&str]) -> impl Iterator<Item = DefId> {
- def_path_res(cx, path)
- .into_iter()
- .filter_map(|res| res.opt_def_id())
-}
-
-pub fn get_trait_def_id(cx: &LateContext<'_>, path: &[&str]) -> Option<DefId> {
- def_path_res(cx, path)
- .into_iter()
- .find_map(|res| match res {
- Res::Def(DefKind::Trait | DefKind::TraitAlias, trait_id) => Some(trait_id),
- _ => None,
- })
-}
-
-/// Checks whether a type implements a trait.
-/// The function returns false in case the type contains an inference variable.
-///
-/// See:
-/// * [`get_trait_def_id`](super::get_trait_def_id) to get a trait [`DefId`].
-/// * [Common tools for writing lints] for an example how to use this function and other options.
-///
-/// [Common tools for writing lints]: https://github.com/rust-lang/rust-clippy/blob/master/book/src/development/common_tools_writing_lints.md#checking-if-a-type-implements-a-specific-trait
-pub fn implements_trait<'tcx>(
- cx: &LateContext<'tcx>,
- ty: Ty<'tcx>,
- trait_id: DefId,
- ty_params: &[GenericArg<'tcx>],
-) -> bool {
- implements_trait_with_env(
- cx.tcx,
- cx.param_env,
- ty,
- trait_id,
- ty_params.iter().map(|&arg| Some(arg)),
- )
-}
-
-/// Same as `implements_trait` but allows using a `ParamEnv` different from the lint context.
-pub fn implements_trait_with_env<'tcx>(
- tcx: TyCtxt<'tcx>,
- param_env: ParamEnv<'tcx>,
- ty: ty::Ty<'tcx>,
- trait_id: DefId,
- ty_params: impl IntoIterator<Item = Option<GenericArg<'tcx>>>,
-) -> bool {
- let ty = tcx.erase_regions(ty);
- if ty.has_escaping_bound_vars() {
- return false;
- }
- let infcx = tcx.infer_ctxt().build();
- let orig = TypeVariableOrigin {
- kind: TypeVariableOriginKind::MiscVariable,
- span: DUMMY_SP,
- };
- let ty_params = tcx.mk_substs_from_iter(
- ty_params
- .into_iter()
- .map(|arg| arg.unwrap_or_else(|| infcx.next_ty_var(orig).into())),
- );
- infcx
- .type_implements_trait(
- trait_id,
- // for some unknown reason we need to have vec here
- // clippy has array
- vec![ty.into()].into_iter().chain(ty_params),
- param_env,
- )
- .must_apply_modulo_regions()
-}
diff --git a/components/script_plugins/trace_in_no_trace.rs b/components/script_plugins/trace_in_no_trace.rs
deleted file mode 100644
index 102f1ae68de..00000000000
--- a/components/script_plugins/trace_in_no_trace.rs
+++ /dev/null
@@ -1,202 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-
-use rustc_ast::ast::{AttrKind, Attribute};
-use rustc_ast::token::TokenKind;
-use rustc_ast::tokenstream::TokenTree;
-use rustc_ast::AttrArgs;
-use rustc_driver::plugin::Registry;
-use rustc_error_messages::MultiSpan;
-use rustc_hir::{self as hir};
-use rustc_lint::{LateContext, LateLintPass, LintContext, LintPass};
-use rustc_middle::ty;
-use rustc_session::declare_lint;
-use rustc_span::symbol::Symbol;
-
-use crate::{get_trait_def_id, implements_trait, symbols};
-
-declare_lint!(
- TRACE_IN_NO_TRACE,
- Deny,
- "Warn and report incorrect usage of Traceable (jsmanaged) objects in must_not_have_traceable marked wrappers"
-);
-
-declare_lint!(
- EMPTY_TRACE_IN_NO_TRACE,
- Warn,
- "Warn about usage of empty Traceable objects in must_not_have_traceable marked wrappers"
-);
-const EMPTY_TRACE_IN_NO_TRACE_MSG: &str =
- "must_not_have_traceable marked wrapper is not needed for types that implements \
-empty Traceable (like primitive types). Consider removing the wrapper.";
-
-pub fn register(reg: &mut Registry) {
- let symbols = Symbols::new();
- reg.lint_store
- .register_lints(&[&TRACE_IN_NO_TRACE, &EMPTY_TRACE_IN_NO_TRACE]);
- reg.lint_store
- .register_late_pass(move |_| Box::new(NotracePass::new(symbols.clone())));
-}
-
-/// Lint for ensuring safe usage of NoTrace wrappers
-///
-/// This lint (disable with `-A trace-in-no-trace`/`#[allow(trace_in_no_trace)]`) ensures that
-/// wrappers marked with must_not_have_traceable(i: usize) only stores
-/// non-jsmanaged (DOES NOT implement JSTraceble) type in i-th generic
-///
-/// For example usage look at the tests
-pub(crate) struct NotracePass {
- symbols: Symbols,
-}
-
-impl NotracePass {
- pub(crate) fn new(symbols: Symbols) -> Self {
- Self { symbols }
- }
-}
-
-impl LintPass for NotracePass {
- fn name(&self) -> &'static str {
- "ServoNotracePass"
- }
-}
-
-fn get_must_not_have_traceable(sym: &Symbols, attrs: &[Attribute]) -> Option<usize> {
- attrs
- .iter()
- .find(|attr| {
- matches!(
- &attr.kind,
- AttrKind::Normal(normal)
- if normal.item.path.segments.len() == 2 &&
- normal.item.path.segments[0].ident.name == sym.trace_in_no_trace_lint &&
- normal.item.path.segments[1].ident.name == sym.must_not_have_traceable
- )
- })
- .map(|x| match &x.get_normal_item().args {
- AttrArgs::Empty => 0,
- AttrArgs::Delimited(a) => match a
- .tokens
- .trees()
- .next()
- .expect("Arguments not found for must_not_have_traceable")
- {
- TokenTree::Token(tok, _) => match tok.kind {
- TokenKind::Literal(lit) => lit.symbol.as_str().parse().unwrap(),
- _ => panic!("must_not_have_traceable expected integer literal here"),
- },
- TokenTree::Delimited(_, _, _) => {
- todo!("must_not_have_traceable does not support multiple notraceable positions")
- },
- },
- _ => {
- panic!("must_not_have_traceable does not support key-value arguments")
- },
- })
-}
-
-fn is_jstraceable<'tcx>(cx: &LateContext<'tcx>, ty: ty::Ty<'tcx>) -> bool {
- // TODO(sagudev): get_trait_def_id is expensive, use lazy and cache it for whole pass
- if let Some(trait_id) = get_trait_def_id(cx, &["mozjs", "gc", "Traceable"]) {
- return implements_trait(cx, ty, trait_id, &[]);
- }
- // when running tests
- if let Some(trait_id) = get_trait_def_id(
- cx,
- &[
- "script_plugins_tests",
- "trace_in_no_trace_lint",
- "JSTraceable",
- ],
- ) {
- return implements_trait(cx, ty, trait_id, &[]);
- }
- panic!("JSTraceable not found");
-}
-
-/// Gives warrning or errors for incorect usage of NoTrace like `NoTrace<impl Traceable>`.
-fn incorrect_no_trace<'tcx, I: Into<MultiSpan> + Copy>(
- sym: &'_ Symbols,
- cx: &LateContext<'tcx>,
- ty: ty::Ty<'tcx>,
- span: I,
-) {
- let mut walker = ty.walk();
- while let Some(generic_arg) = walker.next() {
- let t = match generic_arg.unpack() {
- rustc_middle::ty::subst::GenericArgKind::Type(t) => t,
- _ => {
- walker.skip_current_subtree();
- continue;
- },
- };
- let recur_into_subtree = match t.kind() {
- ty::Adt(did, substs) => {
- if let Some(pos) =
- get_must_not_have_traceable(sym, &cx.tcx.get_attrs_unchecked(did.did()))
- {
- let inner = substs.type_at(pos);
- if inner.is_primitive_ty() {
- cx.lint(
- EMPTY_TRACE_IN_NO_TRACE,
- EMPTY_TRACE_IN_NO_TRACE_MSG,
- |lint| lint.set_span(span),
- )
- } else if is_jstraceable(cx, inner) {
- cx.lint(
- TRACE_IN_NO_TRACE,
- format!(
- "must_not_have_traceable marked wrapper must not have \
-jsmanaged inside on {pos}-th position. Consider removing the wrapper."
- ),
- |lint| lint.set_span(span),
- )
- }
- false
- } else {
- true
- }
- },
- _ => !t.is_primitive_ty(),
- };
- if !recur_into_subtree {
- walker.skip_current_subtree();
- }
- }
-}
-
-// NoTrace correct usage of NoTrace must only be checked on Struct (item) and Enums (variants)
-// as these are the only ones that are actually traced
-impl<'tcx> LateLintPass<'tcx> for NotracePass {
- fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item) {
- // TODO: better performance if we limit with lint attr???
- /*let attrs = cx.tcx.hir().attrs(item.hir_id());
- if has_lint_attr(&self.symbols, &attrs, self.symbols.must_root) {
- return;
- }*/
- if let hir::ItemKind::Struct(def, ..) = &item.kind {
- for ref field in def.fields() {
- let field_type = cx.tcx.type_of(field.def_id);
- incorrect_no_trace(&self.symbols, cx, field_type.0, field.span);
- }
- }
- }
-
- fn check_variant(&mut self, cx: &LateContext, var: &hir::Variant) {
- match var.data {
- hir::VariantData::Tuple(fields, ..) => {
- for field in fields {
- let field_type = cx.tcx.type_of(field.def_id);
- incorrect_no_trace(&self.symbols, cx, field_type.0, field.ty.span);
- }
- },
- _ => (), // Struct variants already caught by check_struct_def
- }
- }
-}
-
-symbols! {
- trace_in_no_trace_lint
- must_not_have_traceable
-}
diff --git a/components/script_plugins/unrooted_must_root.rs b/components/script_plugins/unrooted_must_root.rs
deleted file mode 100644
index 2daea47146c..00000000000
--- a/components/script_plugins/unrooted_must_root.rs
+++ /dev/null
@@ -1,376 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-
-use rustc_ast::ast::{AttrKind, Attribute};
-use rustc_driver::plugin::Registry;
-use rustc_hir::{self as hir, intravisit as visit, ExprKind};
-use rustc_lint::{LateContext, LateLintPass, LintContext, LintPass};
-use rustc_middle::ty;
-use rustc_session::declare_lint;
-use rustc_span::def_id::LocalDefId;
-use rustc_span::source_map;
-use rustc_span::symbol::{sym, Symbol};
-
-use crate::{in_derive_expn, match_def_path, symbols};
-
-declare_lint!(
- UNROOTED_MUST_ROOT,
- Deny,
- "Warn and report usage of unrooted jsmanaged objects"
-);
-
-pub fn register(reg: &mut Registry) {
- let symbols = Symbols::new();
- reg.lint_store.register_lints(&[&UNROOTED_MUST_ROOT]);
- reg.lint_store
- .register_late_pass(move |_| Box::new(UnrootedPass::new(symbols.clone())));
-}
-
-/// Lint for ensuring safe usage of unrooted pointers
-///
-/// This lint (disable with `-A unrooted-must-root`/`#[allow(unrooted_must_root)]`) ensures that
-/// `#[unrooted_must_root_lint::must_root]` values are used correctly.
-///
-/// "Incorrect" usage includes:
-///
-/// - Not being used in a struct/enum field which is not `#[unrooted_must_root_lint::must_root]` itself
-/// - Not being used as an argument to a function (Except onces named `new` and `new_inherited`)
-/// - Not being bound locally in a `let` statement, assignment, `for` loop, or `match` statement.
-///
-/// This helps catch most situations where pointers like `JS<T>` are used in a way that they can be invalidated by a
-/// GC pass.
-///
-/// Structs which have their own mechanism of rooting their unrooted contents (e.g. `ScriptThread`)
-/// can be marked as `#[allow(unrooted_must_root)]`. Smart pointers which root their interior type
-/// can be marked as `#[unrooted_must_root_lint::allow_unrooted_interior]`
-pub(crate) struct UnrootedPass {
- symbols: Symbols,
-}
-
-impl UnrootedPass {
- pub(crate) fn new(symbols: Symbols) -> UnrootedPass {
- UnrootedPass { symbols }
- }
-}
-
-fn has_lint_attr(sym: &Symbols, attrs: &[Attribute], name: Symbol) -> bool {
- attrs.iter().any(|attr| {
- matches!(
- &attr.kind,
- AttrKind::Normal(normal)
- if normal.item.path.segments.len() == 2 &&
- normal.item.path.segments[0].ident.name == sym.unrooted_must_root_lint &&
- normal.item.path.segments[1].ident.name == name
- )
- })
-}
-
-/// Checks if a type is unrooted or contains any owned unrooted types
-fn is_unrooted_ty<'tcx>(
- sym: &'_ Symbols,
- cx: &LateContext<'tcx>,
- ty: ty::Ty<'tcx>,
- in_new_function: bool,
-) -> bool {
- let mut ret = false;
- let mut walker = ty.walk();
- while let Some(generic_arg) = walker.next() {
- let t = match generic_arg.unpack() {
- rustc_middle::ty::subst::GenericArgKind::Type(t) => t,
- _ => {
- walker.skip_current_subtree();
- continue;
- },
- };
- let recur_into_subtree = match t.kind() {
- ty::Adt(did, substs) => {
- let has_attr =
- |did, name| has_lint_attr(sym, &cx.tcx.get_attrs_unchecked(did), name);
- if has_attr(did.did(), sym.must_root) {
- ret = true;
- false
- } else if has_attr(did.did(), sym.allow_unrooted_interior) {
- false
- } else if match_def_path(cx, did.did(), &[sym.alloc, sym.rc, sym.Rc]) {
- // Rc<Promise> is okay
- let inner = substs.type_at(0);
- if let ty::Adt(did, _) = inner.kind() {
- if has_attr(did.did(), sym.allow_unrooted_in_rc) {
- false
- } else {
- true
- }
- } else {
- true
- }
- } else if match_def_path(cx, did.did(), &[sym::core, sym.cell, sym.Ref]) ||
- match_def_path(cx, did.did(), &[sym::core, sym.cell, sym.RefMut]) ||
- match_def_path(cx, did.did(), &[sym::core, sym::slice, sym::iter, sym.Iter]) ||
- match_def_path(
- cx,
- did.did(),
- &[sym::core, sym::slice, sym::iter, sym.IterMut],
- ) ||
- match_def_path(cx, did.did(), &[sym.accountable_refcell, sym.Ref]) ||
- match_def_path(cx, did.did(), &[sym.accountable_refcell, sym.RefMut]) ||
- match_def_path(
- cx,
- did.did(),
- &[sym::std, sym.collections, sym.hash, sym.map, sym.Entry],
- ) ||
- match_def_path(
- cx,
- did.did(),
- &[
- sym::std,
- sym.collections,
- sym.hash,
- sym.map,
- sym.OccupiedEntry,
- ],
- ) ||
- match_def_path(
- cx,
- did.did(),
- &[
- sym::std,
- sym.collections,
- sym.hash,
- sym.map,
- sym.VacantEntry,
- ],
- ) ||
- match_def_path(
- cx,
- did.did(),
- &[sym::std, sym.collections, sym.hash, sym.map, sym.Iter],
- ) ||
- match_def_path(
- cx,
- did.did(),
- &[sym::std, sym.collections, sym.hash, sym.set, sym.Iter],
- )
- {
- // Structures which are semantically similar to an &ptr.
- false
- } else if did.is_box() && in_new_function {
- // box in new() is okay
- false
- } else {
- true
- }
- },
- ty::Ref(..) => false, // don't recurse down &ptrs
- ty::RawPtr(..) => false, // don't recurse down *ptrs
- ty::FnDef(..) | ty::FnPtr(_) => false,
-
- _ => true,
- };
- if !recur_into_subtree {
- walker.skip_current_subtree();
- }
- }
- ret
-}
-
-impl LintPass for UnrootedPass {
- fn name(&self) -> &'static str {
- "ServoUnrootedPass"
- }
-}
-
-impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
- /// All structs containing #[unrooted_must_root_lint::must_root] types
- /// must be #[unrooted_must_root_lint::must_root] themselves
- fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item) {
- let attrs = cx.tcx.hir().attrs(item.hir_id());
- if has_lint_attr(&self.symbols, &attrs, self.symbols.must_root) {
- return;
- }
- if let hir::ItemKind::Struct(def, ..) = &item.kind {
- for ref field in def.fields() {
- let field_type = cx.tcx.type_of(field.def_id);
- if is_unrooted_ty(&self.symbols, cx, field_type.0, false) {
- cx.lint(
- UNROOTED_MUST_ROOT,
- "Type must be rooted, use #[unrooted_must_root_lint::must_root] \
- on the struct definition to propagate",
- |lint| lint.set_span(field.span),
- )
- }
- }
- }
- }
-
- /// All enums containing #[unrooted_must_root_lint::must_root] types
- /// must be #[unrooted_must_root_lint::must_root] themselves
- fn check_variant(&mut self, cx: &LateContext, var: &hir::Variant) {
- let ref map = cx.tcx.hir();
- let parent_item = map.expect_item(map.get_parent_item(var.hir_id).def_id);
- let attrs = cx.tcx.hir().attrs(parent_item.hir_id());
- if !has_lint_attr(&self.symbols, &attrs, self.symbols.must_root) {
- match var.data {
- hir::VariantData::Tuple(fields, ..) => {
- for field in fields {
- let field_type = cx.tcx.type_of(field.def_id);
- if is_unrooted_ty(&self.symbols, cx, field_type.0, false) {
- cx.lint(
- UNROOTED_MUST_ROOT,
- "Type must be rooted, \
- use #[unrooted_must_root_lint::must_root] \
- on the enum definition to propagate",
- |lint| lint.set_span(field.ty.span),
- )
- }
- }
- },
- _ => (), // Struct variants already caught by check_struct_def
- }
- }
- }
- /// Function arguments that are #[unrooted_must_root_lint::must_root] types are not allowed
- fn check_fn(
- &mut self,
- cx: &LateContext<'tcx>,
- kind: visit::FnKind<'tcx>,
- decl: &'tcx hir::FnDecl,
- body: &'tcx hir::Body,
- span: source_map::Span,
- def_id: LocalDefId,
- ) {
- let in_new_function = match kind {
- visit::FnKind::ItemFn(n, _, _) | visit::FnKind::Method(n, _) => {
- &*n.as_str() == "new" || n.as_str().starts_with("new_")
- },
- visit::FnKind::Closure => return,
- };
-
- if !in_derive_expn(span) {
- let sig = cx.tcx.type_of(def_id).0.fn_sig(cx.tcx);
-
- for (arg, ty) in decl.inputs.iter().zip(sig.inputs().skip_binder().iter()) {
- if is_unrooted_ty(&self.symbols, cx, *ty, false) {
- cx.lint(UNROOTED_MUST_ROOT, "Type must be rooted", |lint| {
- lint.set_span(arg.span)
- })
- }
- }
-
- if !in_new_function &&
- is_unrooted_ty(&self.symbols, cx, sig.output().skip_binder(), false)
- {
- cx.lint(UNROOTED_MUST_ROOT, "Type must be rooted", |lint| {
- lint.set_span(decl.output.span())
- })
- }
- }
-
- let mut visitor = FnDefVisitor {
- symbols: &self.symbols,
- cx,
- in_new_function,
- };
- visit::walk_expr(&mut visitor, &body.value);
- }
-}
-
-struct FnDefVisitor<'a, 'tcx: 'a> {
- symbols: &'a Symbols,
- cx: &'a LateContext<'tcx>,
- in_new_function: bool,
-}
-
-impl<'a, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'tcx> {
- type Map = rustc_middle::hir::map::Map<'tcx>;
-
- fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
- let cx = self.cx;
-
- let require_rooted = |cx: &LateContext, in_new_function: bool, subexpr: &hir::Expr| {
- let ty = cx.typeck_results().expr_ty(&subexpr);
- if is_unrooted_ty(&self.symbols, cx, ty, in_new_function) {
- cx.lint(
- UNROOTED_MUST_ROOT,
- format!("Expression of type {:?} must be rooted", ty),
- |lint| lint.set_span(subexpr.span),
- )
- }
- };
-
- match expr.kind {
- // Trait casts from #[unrooted_must_root_lint::must_root] types are not allowed
- ExprKind::Cast(subexpr, _) => require_rooted(cx, self.in_new_function, &subexpr),
- // This catches assignments... the main point of this would be to catch mutable
- // references to `JS<T>`.
- // FIXME: Enable this? Triggers on certain kinds of uses of DomRefCell.
- // hir::ExprAssign(_, ref rhs) => require_rooted(cx, self.in_new_function, &*rhs),
- // This catches calls; basically, this enforces the constraint that only constructors
- // can call other constructors.
- // FIXME: Enable this? Currently triggers with constructs involving DomRefCell, and
- // constructs like Vec<JS<T>> and RootedVec<JS<T>>.
- // hir::ExprCall(..) if !self.in_new_function => {
- // require_rooted(cx, self.in_new_function, expr);
- // }
- _ => {
- // TODO(pcwalton): Check generics with a whitelist of allowed generics.
- },
- }
-
- visit::walk_expr(self, expr);
- }
-
- fn visit_pat(&mut self, pat: &'tcx hir::Pat) {
- let cx = self.cx;
-
- // We want to detect pattern bindings that move a value onto the stack.
- // When "default binding modes" https://github.com/rust-lang/rust/issues/42640
- // are implemented, the `Unannotated` case could cause false-positives.
- // These should be fixable by adding an explicit `ref`.
- match pat.kind {
- hir::PatKind::Binding(hir::BindingAnnotation::NONE, ..) |
- hir::PatKind::Binding(hir::BindingAnnotation::MUT, ..) => {
- let ty = cx.typeck_results().pat_ty(pat);
- if is_unrooted_ty(self.symbols, cx, ty, self.in_new_function) {
- cx.lint(
- UNROOTED_MUST_ROOT,
- format!("Expression of type {:?} must be rooted", ty),
- |lint| lint.set_span(pat.span),
- )
- }
- },
- _ => {},
- }
-
- visit::walk_pat(self, pat);
- }
-
- fn visit_ty(&mut self, _: &'tcx hir::Ty) {}
-
- fn nested_visit_map(&mut self) -> Self::Map {
- self.cx.tcx.hir()
- }
-}
-
-symbols! {
- unrooted_must_root_lint
- allow_unrooted_interior
- allow_unrooted_in_rc
- must_root
- alloc
- rc
- Rc
- cell
- accountable_refcell
- Ref
- RefMut
- Iter
- IterMut
- collections
- hash
- map
- set
- Entry
- OccupiedEntry
- VacantEntry
-}