aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--.cargo/config.toml1
-rw-r--r--.github/workflows/linux.yml1
-rw-r--r--.github/workflows/mac.yml3
-rw-r--r--.github/workflows/windows.yml5
-rw-r--r--Cargo.lock106
-rw-r--r--Cargo.toml1
-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--python/servo/platform/base.py13
-rw-r--r--python/servo/testing_commands.py1
-rw-r--r--python/tidy/tests/ban-domrefcell.rs3
-rw-r--r--python/tidy/tests/ban.rs3
-rw-r--r--rust-toolchain.toml6
-rw-r--r--servo-tidy.toml2
-rw-r--r--support/crown/Cargo.toml19
-rw-r--r--support/crown/src/common.rs (renamed from components/script_plugins/lib.rs)83
-rw-r--r--support/crown/src/crown_is_not_used.rs16
-rw-r--r--support/crown/src/main.rs68
-rw-r--r--support/crown/src/trace_in_no_trace.rs (renamed from components/script_plugins/trace_in_no_trace.rs)46
-rw-r--r--support/crown/src/unrooted_must_root.rs (renamed from components/script_plugins/unrooted_must_root.rs)51
-rw-r--r--support/crown/tests/compile-fail/trace_in_no_trace_composable_works.rs25
-rw-r--r--support/crown/tests/compile-fail/trace_in_no_trace_works.rs19
-rw-r--r--support/crown/tests/compile-fail/unrooted_must_root_parameter.rs10
-rw-r--r--support/crown/tests/compile-fail/unrooted_must_root_return_type.rs13
-rw-r--r--support/crown/tests/compile-fail/unrooted_must_root_struct_field.rs10
-rw-r--r--support/crown/tests/compile_test.rs52
-rw-r--r--support/crown/tests/run-pass/trace_in_no_trace_composable.rs24
-rw-r--r--support/crown/tests/run-pass/trace_in_no_trace_ok.rs18
-rw-r--r--support/crown/tests/run-pass/unrooted_must_root_ok.rs15
-rw-r--r--support/crown/tests/ui/trace_in_no_trace_primitive.rs17
-rw-r--r--support/crown/tests/ui/trace_in_no_trace_primitive.stderr10
-rw-r--r--tests/unit/script_plugins/Cargo.toml13
-rw-r--r--tests/unit/script_plugins/lib.rs164
231 files changed, 881 insertions, 680 deletions
diff --git a/.cargo/config.toml b/.cargo/config.toml
index 10ce481511d..1850ca2ef72 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -42,3 +42,4 @@ MACOSX_DEPLOYMENT_TARGET = "10.10"
[build]
rustdocflags = ["--document-private-items"]
+rustc = "crown"
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
index 751ec6fcabe..6d6d72b6400 100644
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -54,7 +54,6 @@ env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
SCCACHE_GHA_ENABLED: "true"
- RUSTC_WRAPPER: "sccache"
CCACHE: "sccache"
CARGO_INCREMENTAL: 0
diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml
index ea2fe7d35aa..1b593810438 100644
--- a/.github/workflows/mac.yml
+++ b/.github/workflows/mac.yml
@@ -47,7 +47,6 @@ env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
SCCACHE_GHA_ENABLED: "true"
- RUSTC_WRAPPER: "sccache"
CCACHE: "sccache"
CARGO_INCREMENTAL: 0
@@ -136,7 +135,7 @@ jobs:
NIGHTLY_REPO_TOKEN: ${{ secrets.NIGHTLY_REPO_TOKEN }}
NIGHTLY_REPO: ${{ github.repository_owner }}/servo-nightly-builds
- name: Build package for target
- run: gtar -czf target.tar.gz target/${{ inputs.profile }}/servo target/${{ inputs.profile }}/*.dylib target/${{ inputs.profile }}/lib/*.dylib resources
+ run: gtar -czf target.tar.gz target/${{ inputs.profile }}/servo target/${{ inputs.profile }}/lib/*.dylib resources
- name: Upload package for target
uses: actions/upload-artifact@v3
with:
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index 6bb80866533..b8c18701c61 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -73,10 +73,15 @@ jobs:
choco install wixtoolset
echo "C:\\Program Files (x86)\\WiX Toolset v3.11\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Bootstrap
+ env:
+ # We need to override the rustc set in cargo/config.toml, because at
+ # this point crown is not installed yet.
+ RUSTC: "rustc"
run: |
python -m pip install --upgrade pip virtualenv
python mach fetch
python mach bootstrap-gstreamer
+ cargo install --path support/crown
- name: Build (${{ inputs.profile }})
run: python mach build --${{ inputs.profile }}
- name: Copy resources
diff --git a/Cargo.lock b/Cargo.lock
index e674487bf9e..43a4529afa1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -892,6 +892,29 @@ dependencies = [
]
[[package]]
+name = "compiletest_rs"
+version = "0.10.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7225fee1bcf9247bb3a1b1a2d7ecfe2f7a990e549a09d766a257a4ae30dac0d6"
+dependencies = [
+ "diff",
+ "filetime",
+ "getopts",
+ "lazy_static",
+ "libc",
+ "log",
+ "miow",
+ "regex",
+ "rustfix",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "tempfile",
+ "tester",
+ "winapi",
+]
+
+[[package]]
name = "compositing"
version = "0.0.1"
dependencies = [
@@ -1153,6 +1176,14 @@ dependencies = [
]
[[package]]
+name = "crown"
+version = "0.1.0"
+dependencies = [
+ "compiletest_rs",
+ "once_cell",
+]
+
+[[package]]
name = "crunchy"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1361,6 +1392,12 @@ dependencies = [
]
[[package]]
+name = "diff"
+version = "0.1.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
+
+[[package]]
name = "digest"
version = "0.10.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1694,6 +1731,18 @@ dependencies = [
]
[[package]]
+name = "filetime"
+version = "0.2.22"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0"
+dependencies = [
+ "cfg-if 1.0.0",
+ "libc",
+ "redox_syscall 0.3.5",
+ "windows-sys 0.48.0",
+]
+
+[[package]]
name = "fixedbitset"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3598,6 +3647,15 @@ dependencies = [
]
[[package]]
+name = "miow"
+version = "0.3.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
name = "mozangle"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4662,6 +4720,18 @@ dependencies = [
]
[[package]]
+name = "rustfix"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ecd2853d9e26988467753bd9912c3a126f642d05d229a4b53f5752ee36c56481"
+dependencies = [
+ "anyhow",
+ "log",
+ "serde",
+ "serde_json",
+]
+
+[[package]]
name = "rustix"
version = "0.38.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4803,7 +4873,6 @@ dependencies = [
"ref_filter_map",
"regex",
"script_layout_interface",
- "script_plugins",
"script_traits",
"selectors",
"serde",
@@ -4870,17 +4939,6 @@ dependencies = [
]
[[package]]
-name = "script_plugins"
-version = "0.0.1"
-
-[[package]]
-name = "script_plugins_tests"
-version = "0.0.1"
-dependencies = [
- "script_plugins",
-]
-
-[[package]]
name = "script_tests"
version = "0.0.1"
dependencies = [
@@ -5911,6 +5969,17 @@ dependencies = [
]
[[package]]
+name = "term"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f"
+dependencies = [
+ "dirs-next",
+ "rustversion",
+ "winapi",
+]
+
+[[package]]
name = "termcolor"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5920,6 +5989,19 @@ dependencies = [
]
[[package]]
+name = "tester"
+version = "0.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "89e8bf7e0eb2dd7b4228cc1b6821fc5114cd6841ae59f652a85488c016091e5f"
+dependencies = [
+ "cfg-if 1.0.0",
+ "getopts",
+ "libc",
+ "num_cpus",
+ "term",
+]
+
+[[package]]
name = "textwrap"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 27d60bdb5e2..248607bb562 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,6 +6,7 @@ members = [
"ports/libsimpleservo/capi/",
"ports/libsimpleservo/jniapi/",
"tests/unit/*",
+ "support/crown",
]
default-members = ["ports/servoshell"]
exclude = [".cargo"]
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/python/servo/platform/base.py b/python/servo/platform/base.py
index d3d03cf80ef..e8a62400bd9 100644
--- a/python/servo/platform/base.py
+++ b/python/servo/platform/base.py
@@ -97,6 +97,7 @@ class Base:
def bootstrap(self, force: bool):
installed_something = self._platform_bootstrap(force)
installed_something |= self.install_taplo(force)
+ installed_something |= self.install_crown(force)
if not installed_something:
print("Dependencies were already installed!")
@@ -110,6 +111,18 @@ class Base:
return True
+ def install_crown(self, force: bool) -> bool:
+ # We need to override the rustc set in cargo/config.toml because crown
+ # may not be installed yet.
+ env = dict(os.environ)
+ env["CARGO_BUILD_RUSTC"] = "rustc"
+
+ if subprocess.call(["cargo", "install", "--path", "support/crown"],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) != 0:
+ raise EnvironmentError("Installation of crown failed.")
+
+ return True
+
def passive_bootstrap(self) -> bool:
"""A bootstrap method that is called without explicitly invoking `./mach bootstrap`
but that is executed in the process of other `./mach` commands. This should be
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index 06272f555b4..4cbae6acd80 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -218,6 +218,7 @@ class MachCommands(CommandBase):
"script_traits",
"servo_config",
"servo_remutex",
+ "crown",
]
if not packages:
packages = set(os.listdir(path.join(self.context.topdir, "tests", "unit"))) - set(['.DS_Store'])
diff --git a/python/tidy/tests/ban-domrefcell.rs b/python/tidy/tests/ban-domrefcell.rs
index 9bfc9ba8938..75f519c4dc6 100644
--- a/python/tidy/tests/ban-domrefcell.rs
+++ b/python/tidy/tests/ban-domrefcell.rs
@@ -2,9 +2,6 @@
* 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/. */
-#![feature(plugin)]
-#![plugin(script_plugins)]
-
extern crate script;
use script::test::Dom;
diff --git a/python/tidy/tests/ban.rs b/python/tidy/tests/ban.rs
index 9da46d2ee53..2ad140ab5d5 100644
--- a/python/tidy/tests/ban.rs
+++ b/python/tidy/tests/ban.rs
@@ -2,9 +2,6 @@
* 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/. */
-#![feature(plugin)]
-#![plugin(script_plugins)]
-
extern crate js;
use js::jsval::JSVal;
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index 436b347fabc..46cdfdde88c 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,11 +1,13 @@
[toolchain]
channel = "nightly-2023-03-18"
components = [
- # https://github.com/rust-lang/rust/issues/72594#issuecomment-633779564
+ # For support/crown
"llvm-tools",
- # For components/script_plugins, https://github.com/rust-lang/rust/pull/67469
+ # For support/crown
"rustc-dev",
+ # For docs building
"rust-docs",
+ # For formatting
"rustfmt",
]
profile = "minimal"
diff --git a/servo-tidy.toml b/servo-tidy.toml
index 5c3713a78a3..066d2ec6f7e 100644
--- a/servo-tidy.toml
+++ b/servo-tidy.toml
@@ -96,6 +96,8 @@ files = [
]
# Directories that are ignored for the non-WPT tidy check.
directories = [
+ # Test have expectations in them, causing tidy to fail.
+ "./support/crown/tests",
# Upstream
"./support/android/apk",
"./tests/wpt/harness",
diff --git a/support/crown/Cargo.toml b/support/crown/Cargo.toml
new file mode 100644
index 00000000000..19a60cc59e8
--- /dev/null
+++ b/support/crown/Cargo.toml
@@ -0,0 +1,19 @@
+[package]
+name = "crown"
+authors = ["The Servo Project Developers"]
+version = "0.1.0"
+edition = "2021"
+license = "MPL-2.0"
+
+[dev-dependencies]
+compiletest_rs = { version = "0.10", features = ["tmp"] }
+once_cell = "1"
+
+[features]
+default = ["unrooted_must_root_lint", "trace_in_no_trace_lint"]
+unrooted_must_root_lint = []
+trace_in_no_trace_lint = []
+
+[package.metadata.rust-analyzer]
+# This crate uses #![feature(rustc_private)]
+rustc_private = true
diff --git a/components/script_plugins/lib.rs b/support/crown/src/common.rs
index de1ee5f7e53..d360b05069e 100644
--- a/components/script_plugins/lib.rs
+++ b/support/crown/src/common.rs
@@ -2,30 +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/. */
-//! 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};
@@ -39,25 +16,10 @@ 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 {
+pub 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] {
@@ -77,7 +39,7 @@ fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool {
.all(|(e, p)| e.data.get_opt_name().as_ref() == Some(p))
}
-fn in_derive_expn(span: Span) -> bool {
+pub fn in_derive_expn(span: Span) -> bool {
matches!(
span.ctxt().outer_expn_data().kind,
ExpnKind::Macro(MacroKind::Derive, ..)
@@ -276,11 +238,37 @@ pub fn def_path_res(cx: &LateContext<'_>, path: &[&str]) -> Vec<Res> {
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)
+/// Resolves a def path like `std::vec::Vec`, but searches only local crate
+///
+/// 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 less expensive than `def_path_res` and should be used sparingly.
+pub fn def_local_res(cx: &LateContext<'_>, path: &str) -> Vec<Res> {
+ let tcx = cx.tcx;
+ let local_crate = LOCAL_CRATE.as_def_id();
+ let starts = Res::Def(tcx.def_kind(local_crate), local_crate);
+ let mut resolutions: Vec<Res> = vec![starts];
+ let segment = Symbol::intern(path);
+
+ 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
}
pub fn get_trait_def_id(cx: &LateContext<'_>, path: &[&str]) -> Option<DefId> {
@@ -292,6 +280,15 @@ pub fn get_trait_def_id(cx: &LateContext<'_>, path: &[&str]) -> Option<DefId> {
})
}
+pub fn get_local_trait_def_id(cx: &LateContext<'_>, path: &str) -> Option<DefId> {
+ def_local_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.
///
diff --git a/support/crown/src/crown_is_not_used.rs b/support/crown/src/crown_is_not_used.rs
new file mode 100644
index 00000000000..66593a31e05
--- /dev/null
+++ b/support/crown/src/crown_is_not_used.rs
@@ -0,0 +1,16 @@
+/* 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_lint::LintStore;
+use rustc_session::declare_lint;
+
+declare_lint! {
+ CROWN_IS_NOT_USED,
+ Deny,
+ "Issues a rustc warning if crown is not used in compilation"
+}
+
+pub fn register(lint_store: &mut LintStore) {
+ lint_store.register_lints(&[&CROWN_IS_NOT_USED]);
+}
diff --git a/support/crown/src/main.rs b/support/crown/src/main.rs
new file mode 100644
index 00000000000..fa2a16868b1
--- /dev/null
+++ b/support/crown/src/main.rs
@@ -0,0 +1,68 @@
+/* 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/. */
+
+#![feature(rustc_private)]
+#![warn(rustc::internal)]
+#![allow(rustc::potential_query_instability)]
+
+// This rustc crates are private so they must 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_interface;
+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 std::process::ExitCode;
+
+use rustc_driver::Callbacks;
+use rustc_interface::interface::Config;
+
+mod common;
+
+#[cfg(feature = "unrooted_must_root_lint")]
+mod unrooted_must_root;
+
+#[cfg(feature = "trace_in_no_trace_lint")]
+mod trace_in_no_trace;
+
+mod crown_is_not_used;
+
+struct MyCallbacks;
+
+impl Callbacks for MyCallbacks {
+ fn config(&mut self, config: &mut Config) {
+ config.register_lints = Some(Box::new(move |sess, lint_store| {
+ // Skip checks for proc-macro crates.
+ if sess
+ .crate_types()
+ .contains(&rustc_session::config::CrateType::ProcMacro)
+ {
+ return;
+ }
+
+ crown_is_not_used::register(lint_store);
+ #[cfg(feature = "unrooted_must_root_lint")]
+ unrooted_must_root::register(lint_store);
+ #[cfg(feature = "trace_in_no_trace_lint")]
+ trace_in_no_trace::register(lint_store);
+ }));
+ }
+}
+
+fn main() -> ExitCode {
+ rustc_driver::init_env_logger("CROWN_LOG");
+ let args: Vec<_> = std::env::args().collect();
+
+ match rustc_driver::RunCompiler::new(&args, &mut MyCallbacks).run() {
+ Ok(_) => ExitCode::SUCCESS,
+ Err(_) => ExitCode::FAILURE,
+ }
+}
diff --git a/components/script_plugins/trace_in_no_trace.rs b/support/crown/src/trace_in_no_trace.rs
index 102f1ae68de..0e685c242a0 100644
--- a/components/script_plugins/trace_in_no_trace.rs
+++ b/support/crown/src/trace_in_no_trace.rs
@@ -6,37 +6,36 @@ 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_lint::{LateContext, LateLintPass, LintContext, LintPass, LintStore};
use rustc_middle::ty;
-use rustc_session::declare_lint;
+use rustc_session::declare_tool_lint;
use rustc_span::symbol::Symbol;
-use crate::{get_trait_def_id, implements_trait, symbols};
+use crate::common::{get_local_trait_def_id, get_trait_def_id, implements_trait};
+use crate::symbols;
-declare_lint!(
- TRACE_IN_NO_TRACE,
+declare_tool_lint! {
+ pub crown::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,
+declare_tool_lint! {
+ pub crown::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) {
+pub fn register(lint_store: &mut LintStore) {
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_store.register_lints(&[&TRACE_IN_NO_TRACE, &EMPTY_TRACE_IN_NO_TRACE]);
+ lint_store.register_late_pass(move |_| Box::new(NotracePass::new(symbols.clone())));
}
/// Lint for ensuring safe usage of NoTrace wrappers
@@ -69,9 +68,10 @@ fn get_must_not_have_traceable(sym: &Symbols, attrs: &[Attribute]) -> Option<usi
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
+ if normal.item.path.segments.len() == 3 &&
+ normal.item.path.segments[0].ident.name == sym.crown &&
+ normal.item.path.segments[1].ident.name == sym.trace_in_no_trace_lint &&
+ normal.item.path.segments[2].ident.name == sym.must_not_have_traceable
)
})
.map(|x| match &x.get_normal_item().args {
@@ -102,14 +102,7 @@ fn is_jstraceable<'tcx>(cx: &LateContext<'tcx>, ty: ty::Ty<'tcx>) -> bool {
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",
- ],
- ) {
+ if let Some(trait_id) = get_local_trait_def_id(cx, "JSTraceable") {
return implements_trait(cx, ty, trait_id, &[]);
}
panic!("JSTraceable not found");
@@ -197,6 +190,7 @@ impl<'tcx> LateLintPass<'tcx> for NotracePass {
}
symbols! {
+ crown
trace_in_no_trace_lint
must_not_have_traceable
}
diff --git a/components/script_plugins/unrooted_must_root.rs b/support/crown/src/unrooted_must_root.rs
index 2daea47146c..36c22c3170b 100644
--- a/components/script_plugins/unrooted_must_root.rs
+++ b/support/crown/src/unrooted_must_root.rs
@@ -3,38 +3,37 @@
* 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_lint::{LateContext, LateLintPass, LintContext, LintPass, LintStore};
use rustc_middle::ty;
-use rustc_session::declare_lint;
+use rustc_session::declare_tool_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};
+use crate::common::{in_derive_expn, match_def_path};
+use crate::symbols;
-declare_lint!(
- UNROOTED_MUST_ROOT,
+declare_tool_lint! {
+ pub crown::UNROOTED_MUST_ROOT,
Deny,
"Warn and report usage of unrooted jsmanaged objects"
-);
+}
-pub fn register(reg: &mut Registry) {
+pub fn register(lint_store: &mut LintStore) {
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_store.register_lints(&[&UNROOTED_MUST_ROOT]);
+ 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.
+/// `#[crown::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 in a struct/enum field which is not `#[crown::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.
///
@@ -43,7 +42,7 @@ pub fn register(reg: &mut Registry) {
///
/// 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]`
+/// can be marked as `#[crown::unrooted_must_root_lint::allow_unrooted_interior]`
pub(crate) struct UnrootedPass {
symbols: Symbols,
}
@@ -59,9 +58,10 @@ fn has_lint_attr(sym: &Symbols, attrs: &[Attribute], name: Symbol) -> bool {
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
+ if normal.item.path.segments.len() == 3 &&
+ normal.item.path.segments[0].ident.name == sym.crown &&
+ normal.item.path.segments[1].ident.name == sym.unrooted_must_root_lint &&
+ normal.item.path.segments[2].ident.name == name
)
})
}
@@ -181,8 +181,8 @@ impl LintPass for UnrootedPass {
}
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
+ /// All structs containing #[crown::unrooted_must_root_lint::must_root] types
+ /// must be #[crown::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) {
@@ -194,7 +194,7 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
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] \
+ "Type must be rooted, use #[crown::unrooted_must_root_lint::must_root] \
on the struct definition to propagate",
|lint| lint.set_span(field.span),
)
@@ -203,8 +203,8 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
}
}
- /// All enums containing #[unrooted_must_root_lint::must_root] types
- /// must be #[unrooted_must_root_lint::must_root] themselves
+ /// All enums containing #[crown::unrooted_must_root_lint::must_root] types
+ /// must be #[crown::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);
@@ -218,7 +218,7 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
cx.lint(
UNROOTED_MUST_ROOT,
"Type must be rooted, \
- use #[unrooted_must_root_lint::must_root] \
+ use #[crown::unrooted_must_root_lint::must_root] \
on the enum definition to propagate",
|lint| lint.set_span(field.ty.span),
)
@@ -229,7 +229,7 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
}
}
}
- /// Function arguments that are #[unrooted_must_root_lint::must_root] types are not allowed
+ /// Function arguments that are #[crown::unrooted_must_root_lint::must_root] types are not allowed
fn check_fn(
&mut self,
cx: &LateContext<'tcx>,
@@ -299,7 +299,7 @@ impl<'a, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'tcx> {
};
match expr.kind {
- // Trait casts from #[unrooted_must_root_lint::must_root] types are not allowed
+ // Trait casts from #[crown::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>`.
@@ -353,6 +353,7 @@ impl<'a, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'tcx> {
}
symbols! {
+ crown
unrooted_must_root_lint
allow_unrooted_interior
allow_unrooted_in_rc
diff --git a/support/crown/tests/compile-fail/trace_in_no_trace_composable_works.rs b/support/crown/tests/compile-fail/trace_in_no_trace_composable_works.rs
new file mode 100644
index 00000000000..8b8ed813052
--- /dev/null
+++ b/support/crown/tests/compile-fail/trace_in_no_trace_composable_works.rs
@@ -0,0 +1,25 @@
+/* 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/. */
+// compile-flags: --error-format=human
+/// Mock `JSTraceable`
+pub trait JSTraceable {}
+
+struct TraceableStruct;
+impl JSTraceable for TraceableStruct {}
+
+struct NotTraceableStruct;
+
+// `must_not_have_traceable(1)` indicates that the second generic argument should
+// not be traceable and this test verifies that this lint passes enforces this.
+#[crown::trace_in_no_trace_lint::must_not_have_traceable(1)]
+struct NoTraceComposable<Traceable, NoTraceable> {
+ t: Traceable,
+ n: NoTraceable,
+}
+
+// The lint should fail because TraceableStruct is traceable
+struct Foo(NoTraceComposable<TraceableStruct, TraceableStruct>);
+//~^ ERROR: must_not_have_traceable marked wrapper must not have jsmanaged inside on 1-th position. Consider removing the wrapper.
+
+fn main() {}
diff --git a/support/crown/tests/compile-fail/trace_in_no_trace_works.rs b/support/crown/tests/compile-fail/trace_in_no_trace_works.rs
new file mode 100644
index 00000000000..e45964e56f1
--- /dev/null
+++ b/support/crown/tests/compile-fail/trace_in_no_trace_works.rs
@@ -0,0 +1,19 @@
+/* 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/. */
+
+/// Mock `JSTraceable`
+pub trait JSTraceable {}
+
+struct TraceableStruct;
+impl JSTraceable for TraceableStruct {}
+
+struct NotTraceableStruct;
+
+#[crown::trace_in_no_trace_lint::must_not_have_traceable]
+struct NoTrace<T>(T);
+
+struct Foo(NoTrace<TraceableStruct>);
+//~^ ERROR: must_not_have_traceable marked wrapper must not have jsmanaged inside on 0-th position. Consider removing the wrapper.
+
+fn main() {}
diff --git a/support/crown/tests/compile-fail/unrooted_must_root_parameter.rs b/support/crown/tests/compile-fail/unrooted_must_root_parameter.rs
new file mode 100644
index 00000000000..626832cd567
--- /dev/null
+++ b/support/crown/tests/compile-fail/unrooted_must_root_parameter.rs
@@ -0,0 +1,10 @@
+/* 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/. */
+
+#[crown::unrooted_must_root_lint::must_root]
+struct Foo(i32);
+
+fn foo1(_: Foo) {} //~ ERROR: Type must be rooted
+
+fn main() {}
diff --git a/support/crown/tests/compile-fail/unrooted_must_root_return_type.rs b/support/crown/tests/compile-fail/unrooted_must_root_return_type.rs
new file mode 100644
index 00000000000..768e56b258c
--- /dev/null
+++ b/support/crown/tests/compile-fail/unrooted_must_root_return_type.rs
@@ -0,0 +1,13 @@
+/* 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/. */
+
+#[crown::unrooted_must_root_lint::must_root]
+struct Foo(i32);
+
+fn foo2() -> Foo {
+ //~^ ERROR: Type must be rooted
+ unimplemented!()
+}
+
+fn main() {}
diff --git a/support/crown/tests/compile-fail/unrooted_must_root_struct_field.rs b/support/crown/tests/compile-fail/unrooted_must_root_struct_field.rs
new file mode 100644
index 00000000000..5c132577c32
--- /dev/null
+++ b/support/crown/tests/compile-fail/unrooted_must_root_struct_field.rs
@@ -0,0 +1,10 @@
+/* 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/. */
+
+#[crown::unrooted_must_root_lint::must_root]
+struct Foo(i32);
+struct Bar(Foo);
+//~^ ERROR: Type must be rooted, use #[crown::unrooted_must_root_lint::must_root] on the struct definition to propagate
+
+fn main() {}
diff --git a/support/crown/tests/compile_test.rs b/support/crown/tests/compile_test.rs
new file mode 100644
index 00000000000..604fcf1d876
--- /dev/null
+++ b/support/crown/tests/compile_test.rs
@@ -0,0 +1,52 @@
+/* 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 std::env;
+use std::path::PathBuf;
+
+use compiletest_rs as compiletest;
+use once_cell::sync::Lazy;
+
+static PROFILE_PATH: Lazy<PathBuf> = Lazy::new(|| {
+ let current_exe_path = env::current_exe().unwrap();
+ let deps_path = current_exe_path.parent().unwrap();
+ let profile_path = deps_path.parent().unwrap();
+ profile_path.into()
+});
+
+fn run_mode(mode: &'static str, bless: bool) {
+ let mut config = compiletest::Config {
+ bless,
+ edition: Some("2021".into()),
+ ..Default::default()
+ }
+ .tempdir();
+
+ let cfg_mode = mode.parse().expect("Invalid mode");
+ config.mode = cfg_mode;
+ config.src_base = PathBuf::from("tests").join(mode);
+ config.rustc_path = PROFILE_PATH.join("crown");
+ config.target_rustcflags = Some(format!(
+ "-L {} -L {} -Zcrate-attr=feature(register_tool) -Zcrate-attr=register_tool(crown)",
+ PROFILE_PATH.display(),
+ PROFILE_PATH.join("deps").display()
+ ));
+ // Does not work reliably: https://github.com/servo/servo/pull/30508#issuecomment-1834542203
+ //config.link_deps();
+ config.clean_rmeta();
+ config.strict_headers = true;
+
+ compiletest::run_tests(&config);
+}
+
+#[test]
+fn compile_test() {
+ let bless = env::var("BLESS").map_or(false, |x| !x.trim().is_empty());
+ run_mode("compile-fail", bless);
+ run_mode("run-pass", bless);
+ // UI test fails on windows
+ if !cfg!(windows) {
+ run_mode("ui", bless);
+ }
+}
diff --git a/support/crown/tests/run-pass/trace_in_no_trace_composable.rs b/support/crown/tests/run-pass/trace_in_no_trace_composable.rs
new file mode 100644
index 00000000000..1d642ad85e1
--- /dev/null
+++ b/support/crown/tests/run-pass/trace_in_no_trace_composable.rs
@@ -0,0 +1,24 @@
+/* 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/. */
+
+/// Mock `JSTraceable`
+pub trait JSTraceable {}
+
+struct TraceableStruct;
+impl JSTraceable for TraceableStruct {}
+
+struct NotTraceableStruct;
+
+// `must_not_have_traceable(1)` indicates that the second generic argument should
+// not be traceable and this test verifies that this lint passes.
+#[crown::trace_in_no_trace_lint::must_not_have_traceable(1)]
+struct NoTraceComposable<Traceable, NoTraceable> {
+ t: Traceable,
+ n: NoTraceable,
+}
+
+// this is ok: TraceableStruct is traceable
+struct Foo(NoTraceComposable<TraceableStruct, NotTraceableStruct>);
+
+fn main() {}
diff --git a/support/crown/tests/run-pass/trace_in_no_trace_ok.rs b/support/crown/tests/run-pass/trace_in_no_trace_ok.rs
new file mode 100644
index 00000000000..6c573c2f105
--- /dev/null
+++ b/support/crown/tests/run-pass/trace_in_no_trace_ok.rs
@@ -0,0 +1,18 @@
+/* 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/. */
+
+/// Mock `JSTraceable`
+pub trait JSTraceable {}
+
+struct TraceableStruct;
+impl JSTraceable for TraceableStruct {}
+
+struct NotTraceableStruct;
+
+#[crown::trace_in_no_trace_lint::must_not_have_traceable]
+struct NoTrace<T>(T);
+
+struct Foo(NoTrace<NotTraceableStruct>);
+
+fn main() {}
diff --git a/support/crown/tests/run-pass/unrooted_must_root_ok.rs b/support/crown/tests/run-pass/unrooted_must_root_ok.rs
new file mode 100644
index 00000000000..e556143d8a2
--- /dev/null
+++ b/support/crown/tests/run-pass/unrooted_must_root_ok.rs
@@ -0,0 +1,15 @@
+/* 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/. */
+// compile-flags: --error-format=human
+#[crown::unrooted_must_root_lint::must_root]
+struct Foo(i32);
+#[crown::unrooted_must_root_lint::must_root]
+struct Bar(Foo);
+
+fn foo1(_: &Foo) {}
+fn foo2(_: &()) -> &Foo {
+ unimplemented!()
+}
+
+fn main() {}
diff --git a/support/crown/tests/ui/trace_in_no_trace_primitive.rs b/support/crown/tests/ui/trace_in_no_trace_primitive.rs
new file mode 100644
index 00000000000..d1f765a3afd
--- /dev/null
+++ b/support/crown/tests/ui/trace_in_no_trace_primitive.rs
@@ -0,0 +1,17 @@
+/* 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/. */
+
+/// Mock `JSTraceable`
+pub trait JSTraceable {}
+impl JSTraceable for i32 {}
+
+// second generic argument must not be traceable
+#[crown::trace_in_no_trace_lint::must_not_have_traceable(0)]
+struct NoTrace<NoTraceable> {
+ n: NoTraceable,
+}
+
+struct Foo(NoTrace<i32>);
+
+fn main() {}
diff --git a/support/crown/tests/ui/trace_in_no_trace_primitive.stderr b/support/crown/tests/ui/trace_in_no_trace_primitive.stderr
new file mode 100644
index 00000000000..b3e8178289a
--- /dev/null
+++ b/support/crown/tests/ui/trace_in_no_trace_primitive.stderr
@@ -0,0 +1,10 @@
+warning: must_not_have_traceable marked wrapper is not needed for types that implements empty Traceable (like primitive types). Consider removing the wrapper.
+ --> $DIR/trace_in_no_trace_primitive.rs:15:12
+ |
+15 | struct Foo(NoTrace<i32>);
+ | ^^^^^^^^^^^^
+ |
+ = note: `#[warn(crown::empty_trace_in_no_trace)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/unit/script_plugins/Cargo.toml b/tests/unit/script_plugins/Cargo.toml
deleted file mode 100644
index d1ce3c2de5d..00000000000
--- a/tests/unit/script_plugins/Cargo.toml
+++ /dev/null
@@ -1,13 +0,0 @@
-[package]
-name = "script_plugins_tests"
-version = "0.0.1"
-authors = ["The Servo Project Developers"]
-license = "MPL-2.0"
-edition = "2018"
-
-[lib]
-path = "lib.rs"
-test = false
-
-[dependencies]
-script_plugins = {path = "../../../components/script_plugins", features = ["unrooted_must_root_lint", "trace_in_no_trace_lint"]}
diff --git a/tests/unit/script_plugins/lib.rs b/tests/unit/script_plugins/lib.rs
deleted file mode 100644
index b36766c2ae3..00000000000
--- a/tests/unit/script_plugins/lib.rs
+++ /dev/null
@@ -1,164 +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/. */
-
-#[rustfmt::skip]
-pub mod unrooted_must_root {
- /**
- ```
- #![feature(plugin, register_tool)]
- #![plugin(script_plugins)]
- #![register_tool(unrooted_must_root_lint)]
-
- #[unrooted_must_root_lint::must_root] struct Foo(i32);
- #[unrooted_must_root_lint::must_root] struct Bar(Foo);
-
- fn foo1(_: &Foo) {}
- fn foo2(_: &()) -> &Foo { unimplemented!() }
-
- fn main() {}
- ```
- */
- pub fn ok() {}
-
- /**
- ```compile_fail
- #![feature(plugin, register_tool)]
- #![plugin(script_plugins)]
- #![register_tool(unrooted_must_root_lint)]
-
- #[unrooted_must_root_lint::must_root] struct Foo(i32);
- struct Bar(Foo);
-
- fn main() {}
- ```
- */
- pub fn struct_field() {}
-
- /**
- ```compile_fail
- #![feature(plugin, register_tool)]
- #![plugin(script_plugins)]
- #![register_tool(unrooted_must_root_lint)]
-
- #[unrooted_must_root_lint::must_root] struct Foo(i32);
-
- fn foo1(_: Foo) {}
-
- fn main() {}
- ```
- */
- pub fn parameter() {}
-
- /**
- ```compile_fail
- #![feature(plugin, register_tool)]
- #![plugin(script_plugins)]
- #![register_tool(unrooted_must_root_lint)]
-
- #[unrooted_must_root_lint::must_root] struct Foo(i32);
-
- fn foo2() -> Foo { unimplemented!() }
-
- fn main() {}
- ```
- */
- pub fn return_type() {}
-
-}
-
-#[rustfmt::skip]
-pub mod trace_in_no_trace_lint {
- /// Fake jstraceable
- pub trait JSTraceable {}
- impl JSTraceable for i32 {}
-
- /**
- ```
- #![allow(deprecated)]
- #![feature(plugin, register_tool)]
- #![plugin(script_plugins)]
- #![register_tool(trace_in_no_trace_lint)]
-
- use script_plugins_tests::trace_in_no_trace_lint::JSTraceable;
-
- #[trace_in_no_trace_lint::must_not_have_traceable] struct NoTrace<T>(T);
-
- struct Bar;
-
- struct Foo(NoTrace<Bar>);
-
- fn main() {}
- ```
- */
- pub fn ok() {}
-
- /**
- ```compile_fail
- #![allow(deprecated)]
- #![feature(plugin, register_tool)]
- #![plugin(script_plugins)]
- #![register_tool(trace_in_no_trace_lint)]
-
- use script_plugins_tests::trace_in_no_trace_lint::JSTraceable;
-
- #[trace_in_no_trace_lint::must_not_have_traceable] struct NoTrace<T>(T);
-
- struct Bar;
- impl JSTraceable for Bar {}
-
- struct Foo(NoTrace<Bar>);
-
- fn main() {}
- ```
- */
- pub fn works() {}
-
- /**
- ```
- #![allow(deprecated)]
- #![feature(plugin, register_tool)]
- #![plugin(script_plugins)]
- #![register_tool(trace_in_no_trace_lint)]
-
- use script_plugins_tests::trace_in_no_trace_lint::JSTraceable;
-
- // second generic argument must not be traceable
- #[trace_in_no_trace_lint::must_not_have_traceable(1)]
- struct NoTraceComposable<Traceable, NoTraceable> {
- t: Traceable,
- n: NoTraceable,
- }
-
- // this is ok u32 is not traceable
- struct Foo(NoTraceComposable<i32, u32>);
-
- fn main() {}
- ```
- */
- pub fn composable_ok() {}
-
- /**
- ```
- #![allow(deprecated)]
- #![feature(plugin, register_tool)]
- #![plugin(script_plugins)]
- #![register_tool(trace_in_no_trace_lint)]
-
- use script_plugins_tests::trace_in_no_trace_lint::JSTraceable;
-
- // second generic argument must not be traceable
- #[trace_in_no_trace_lint::must_not_have_traceable(1)]
- struct NoTraceComposable<Traceable, NoTraceable> {
- t: Traceable,
- n: NoTraceable,
- }
-
- // this is not ok i32 is traceable
- struct Foo(NoTraceComposable<u32, i32>);
-
- fn main() {}
- ```
- */
- pub fn composable_works() {}
-}