Skip to content

Commit f0eb292

Browse files
authored
Make the crown disabled warning clearer and less scary (servo#37535)
Instead of printing a Rust compilation warning, simply print a message before every build (when using `mach`) that shows the build configuration and whether or not `crown` is enabled. Fixes servo#32597. Signed-off-by: Martin Robinson <[email protected]>
1 parent 824755d commit f0eb292

File tree

5 files changed

+4
-30
lines changed

5 files changed

+4
-30
lines changed

components/script/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@
55
#![cfg_attr(crown, feature(register_tool))]
66
#![deny(unsafe_code)]
77
#![doc = "The script crate contains all matters DOM."]
8-
// Register the linter `crown`, which is the Servo-specific linter for the script
9-
// crate. Issue a warning if `crown` is not being used to compile, but not when
10-
// building rustdoc or running clippy.
8+
// Register the linter `crown`, which is the Servo-specific linter for the script crate.
119
#![cfg_attr(crown, register_tool(crown))]
12-
#![cfg_attr(any(doc, clippy), allow(unknown_lints))]
13-
#![deny(crown_is_not_used)]
1410

1511
// These are used a lot so let's keep them for now
1612
#[macro_use]

components/script_bindings/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
44

55
#![cfg_attr(crown, feature(register_tool))]
6-
// Register the linter `crown`, which is the Servo-specific linter for the script
7-
// crate. Issue a warning if `crown` is not being used to compile, but not when
8-
// building rustdoc or running clippy.
6+
// Register the linter `crown`, which is the Servo-specific linter for the script crate.
97
#![cfg_attr(crown, register_tool(crown))]
10-
#![cfg_attr(any(doc, clippy), allow(unknown_lints))]
11-
#![deny(crown_is_not_used)]
128

139
#[macro_use]
1410
extern crate js;

python/servo/build_commands.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ def build(
146146
# Gather Cargo build timings (https://doc.rust-lang.org/cargo/reference/timings.html).
147147
opts = ["--timings"] + opts
148148

149+
crown_enabled = "enabled" if kwargs.get("use_crown", False) else "disabled (no JS garbage collection linting)"
150+
print(f"Building `{build_type.directory_name()}` build with crown {crown_enabled}.")
149151
if very_verbose:
150-
print(["Calling", "cargo", "build"] + opts)
151152
for key in env:
152153
print((key, env[key]))
153154

support/crown/src/crown_is_not_used.rs

Lines changed: 0 additions & 16 deletions
This file was deleted.

support/crown/src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ mod unrooted_must_root;
3535
#[cfg(feature = "trace_in_no_trace_lint")]
3636
mod trace_in_no_trace;
3737

38-
mod crown_is_not_used;
39-
4038
struct MyCallbacks;
4139

4240
impl Callbacks for MyCallbacks {
@@ -51,7 +49,6 @@ impl Callbacks for MyCallbacks {
5149
return;
5250
}
5351

54-
crown_is_not_used::register(lint_store);
5552
#[cfg(feature = "unrooted_must_root_lint")]
5653
unrooted_must_root::register(lint_store);
5754
#[cfg(feature = "trace_in_no_trace_lint")]

0 commit comments

Comments
 (0)