aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-07-12 07:29:25 -0700
committerGitHub <noreply@github.com>2016-07-12 07:29:25 -0700
commit74925460952ac070ff5e365b6fe6b886fd81861b (patch)
tree3ed21456aca89873f657b3f179861a5ae8224ec5
parente2e7013e7629af1b1da4b944798bee00d4eae2d2 (diff)
parent2091981db863088688d0c054618b2850ae4aae81 (diff)
downloadservo-74925460952ac070ff5e365b6fe6b886fd81861b.tar.gz
servo-74925460952ac070ff5e365b6fe6b886fd81861b.zip
Auto merge of #12409 - Manishearth:clippy, r=nox
Update clippy, improve clippy integration This makes it much easier to run rustfix on servo (rustfix is still pretty buggy though) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12409) <!-- Reviewable:end -->
-rw-r--r--components/plugins/Cargo.toml6
-rw-r--r--components/plugins/lib.rs12
-rw-r--r--components/servo/Cargo.lock2
-rw-r--r--components/style/Cargo.toml3
-rw-r--r--components/style/attr.rs2
-rw-r--r--components/style/custom_properties.rs2
-rw-r--r--components/style/lib.rs1
-rw-r--r--components/style/matching.rs19
-rw-r--r--components/util/Cargo.toml3
-rw-r--r--components/util/lib.rs1
-rw-r--r--ports/cef/Cargo.lock2
-rw-r--r--python/servo/devenv_commands.py16
12 files changed, 43 insertions, 26 deletions
diff --git a/components/plugins/Cargo.toml b/components/plugins/Cargo.toml
index 331adbe5845..c60cc48b779 100644
--- a/components/plugins/Cargo.toml
+++ b/components/plugins/Cargo.toml
@@ -12,10 +12,10 @@ plugin = true
[dependencies]
tenacious = "0.2.0"
-[dependencies.clippy]
-git = "https://github.com/Manishearth/rust-clippy"
-rev = "9dca15de3e8ea266d3e7e868c0f358ed4fa5f195"
+[dependencies.clippy_lints]
+version = "0.0.77"
optional = true
[features]
default = []
+clippy = ["clippy_lints"]
diff --git a/components/plugins/lib.rs b/components/plugins/lib.rs
index 9ee553145a5..52bfad7e049 100644
--- a/components/plugins/lib.rs
+++ b/components/plugins/lib.rs
@@ -18,7 +18,7 @@
#![deny(unsafe_code)]
#[cfg(feature = "clippy")]
-extern crate clippy;
+extern crate clippy_lints;
#[macro_use]
extern crate rustc;
extern crate rustc_plugin;
@@ -44,12 +44,14 @@ mod utils;
#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
reg.register_syntax_extension(intern("dom_struct"), MultiModifier(box jstraceable::expand_dom_struct));
- reg.register_syntax_extension(intern("derive_JSTraceable"), MultiDecorator(box jstraceable::expand_jstraceable));
- reg.register_syntax_extension(intern("_generate_reflector"), MultiDecorator(box reflector::expand_reflector));
- reg.register_late_lint_pass(box lints::transmute_type::TransmutePass);
+ reg.register_syntax_extension(intern("derive_JSTraceable"),
+ MultiDecorator(box jstraceable::expand_jstraceable));
+ reg.register_syntax_extension(intern("_generate_reflector"),
+ MultiDecorator(box reflector::expand_reflector));
reg.register_late_lint_pass(box lints::unrooted_must_root::UnrootedPass::new());
reg.register_late_lint_pass(box lints::privatize::PrivatizePass);
reg.register_late_lint_pass(box lints::inheritance_integrity::InheritancePass);
+ reg.register_late_lint_pass(box lints::transmute_type::TransmutePass);
reg.register_early_lint_pass(box lints::ban::BanPass);
reg.register_late_lint_pass(box tenacious::TenaciousPass);
reg.register_attribute("must_root".to_string(), Whitelisted);
@@ -60,7 +62,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
#[cfg(feature = "clippy")]
fn register_clippy(reg: &mut Registry) {
- ::clippy::plugin_registrar(reg);
+ ::clippy_lints::register_plugins(reg);
}
#[cfg(not(feature = "clippy"))]
fn register_clippy(_reg: &mut Registry) {
diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock
index abcd86d8e07..6d293b3a476 100644
--- a/components/servo/Cargo.lock
+++ b/components/servo/Cargo.lock
@@ -2240,6 +2240,7 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
+ "plugins 0.0.1",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2464,6 +2465,7 @@ dependencies = [
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "plugins 0.0.1",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml
index 049dd560eeb..d20d529b93b 100644
--- a/components/style/Cargo.toml
+++ b/components/style/Cargo.toml
@@ -16,7 +16,7 @@ servo = ["serde", "serde/nightly", "serde_macros", "heapsize", "heapsize_plugin"
"style_traits/servo", "app_units/plugins", "euclid/plugins",
"cssparser/heap_size", "cssparser/serde-serialization",
"selectors/heap_size", "selectors/unstable", "string_cache/heap_size",
- "url/heap_size"]
+ "url/heap_size", "plugins"]
[dependencies]
app_units = "0.2.5"
@@ -45,6 +45,7 @@ style_traits = {path = "../style_traits"}
time = "0.1"
url = "1.0.0"
util = {path = "../util"}
+plugins = {path = "../plugins", optional = true}
[target.'cfg(windows)'.dependencies]
kernel32-sys = "0.2"
diff --git a/components/style/attr.rs b/components/style/attr.rs
index 409f6bdbd56..6ca278d7d2c 100644
--- a/components/style/attr.rs
+++ b/components/style/attr.rs
@@ -490,7 +490,7 @@ pub fn parse_length(mut value: &str) -> LengthOrPercentageOrAuto {
}
// Step 5
- if value.starts_with("+") {
+ if value.starts_with('+') {
value = &value[1..]
}
diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs
index db7316fa0c0..5a7109f77ac 100644
--- a/components/style/custom_properties.rs
+++ b/components/style/custom_properties.rs
@@ -194,7 +194,7 @@ fn parse_declaration_value_block(input: &mut Parser,
let token_slice = input.slice_from(token_start);
if !token_slice.ends_with("*/") {
missing_closing_characters.push_str(
- if token_slice.ends_with("*") { "/" } else { "*/" })
+ if token_slice.ends_with('*') { "/" } else { "*/" })
}
token.serialization_type()
}
diff --git a/components/style/lib.rs b/components/style/lib.rs
index d92524c8877..813a24af14e 100644
--- a/components/style/lib.rs
+++ b/components/style/lib.rs
@@ -27,6 +27,7 @@
#![cfg_attr(feature = "servo", feature(custom_derive))]
#![cfg_attr(feature = "servo", feature(plugin))]
#![cfg_attr(feature = "servo", plugin(heapsize_plugin))]
+#![cfg_attr(feature = "servo", plugin(plugins))]
#![cfg_attr(feature = "servo", plugin(serde_macros))]
#![deny(unsafe_code)]
diff --git a/components/style/matching.rs b/components/style/matching.rs
index 251d46d70b6..194e58907fb 100644
--- a/components/style/matching.rs
+++ b/components/style/matching.rs
@@ -602,17 +602,14 @@ pub trait ElementMatchMethods : TElement
}
for (i, &(ref candidate, ())) in style_sharing_candidate_cache.iter().enumerate() {
- match self.share_style_with_candidate_if_possible(parent.clone(), candidate) {
- Some(shared_style) => {
- // Yay, cache hit. Share the style.
- let node = self.as_node();
- let style = &mut node.mutate_data().unwrap().style;
- let damage = <<Self as TElement>::ConcreteNode as TNode>
- ::ConcreteRestyleDamage::compute((*style).as_ref(), &*shared_style);
- *style = Some(shared_style);
- return StyleSharingResult::StyleWasShared(i, damage)
- }
- None => {}
+ if let Some(shared_style) = self.share_style_with_candidate_if_possible(parent.clone(), candidate) {
+ // Yay, cache hit. Share the style.
+ let node = self.as_node();
+ let style = &mut node.mutate_data().unwrap().style;
+ let damage = <<Self as TElement>::ConcreteNode as TNode>
+ ::ConcreteRestyleDamage::compute((*style).as_ref(), &*shared_style);
+ *style = Some(shared_style);
+ return StyleSharingResult::StyleWasShared(i, damage)
}
}
diff --git a/components/util/Cargo.toml b/components/util/Cargo.toml
index 3a9478a49b3..b9954763d24 100644
--- a/components/util/Cargo.toml
+++ b/components/util/Cargo.toml
@@ -11,7 +11,7 @@ path = "lib.rs"
[features]
# servo as opposed to geckolib
servo = ["serde", "serde_macros", "backtrace", "ipc-channel", "app_units/plugins",
- "euclid/plugins", "euclid/unstable", "url/heap_size", "url/serde"]
+ "euclid/plugins", "euclid/unstable", "url/heap_size", "url/serde", "plugins"]
[dependencies]
app_units = "0.2.5"
@@ -28,6 +28,7 @@ rustc-serialize = "0.3"
serde = {version = "0.7.11", optional = true}
serde_macros = {version = "0.7.11", optional = true}
url = "1.0.0"
+plugins = {path = "../plugins", optional = true}
[target.'cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))'.dependencies]
xdg = "2.0"
diff --git a/components/util/lib.rs b/components/util/lib.rs
index 2e57d5a5f4b..6b906f83c8d 100644
--- a/components/util/lib.rs
+++ b/components/util/lib.rs
@@ -7,6 +7,7 @@
#![cfg_attr(feature = "servo", feature(plugin))]
#![cfg_attr(feature = "servo", feature(reflect_marker))]
#![cfg_attr(feature = "servo", plugin(serde_macros))]
+#![cfg_attr(feature = "servo", plugin(plugins))]
#![deny(unsafe_code)]
diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock
index 443ca6ec95d..1cdd57c7f1e 100644
--- a/ports/cef/Cargo.lock
+++ b/ports/cef/Cargo.lock
@@ -2125,6 +2125,7 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
+ "plugins 0.0.1",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2333,6 +2334,7 @@ dependencies = [
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "plugins 0.0.1",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py
index 2619827c226..a4bfa5c5df1 100644
--- a/python/servo/devenv_commands.py
+++ b/python/servo/devenv_commands.py
@@ -94,11 +94,21 @@ class MachCommands(CommandBase):
@Command('clippy',
description='Run Clippy',
category='devenv')
- def clippy(self):
- features = "--features=script/plugins/clippy"
+ @CommandArgument(
+ '--package', '-p', default=None,
+ help='Updates the selected package')
+ @CommandArgument(
+ '--json', '-j', action="store_true",
+ help='Outputs')
+ def clippy(self, package=None, json=False):
+ params = ["--features=script/plugins/clippy"]
+ if package:
+ params += ["-p", package]
+ if json:
+ params += ["--", "-Zunstable-options", "--error-format", "json"]
with cd(path.join(self.context.topdir, "components", "servo")):
- return subprocess.call(["cargo", "build", features],
+ return subprocess.call(["cargo", "rustc", "-v"] + params,
env=self.build_env())
@Command('rustc',