diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2014-09-21 00:47:13 +0530 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2014-09-23 17:37:28 +0530 |
commit | 5b866e9e4616c63c99ef5c945d3fbaf429b1b460 (patch) | |
tree | c6226c89a8ba9171e2d3a37c20b23902c8fc3919 /components/plugins | |
parent | 2a4f9fd8a33734811acdb6d69d4f479f91527d6e (diff) | |
download | servo-5b866e9e4616c63c99ef5c945d3fbaf429b1b460.tar.gz servo-5b866e9e4616c63c99ef5c945d3fbaf429b1b460.zip |
Fix CEF
Diffstat (limited to 'components/plugins')
-rw-r--r-- | components/plugins/lib.rs | 2 | ||||
-rw-r--r-- | components/plugins/lints.rs | 10 | ||||
-rw-r--r-- | components/plugins/tests.rs | 39 |
3 files changed, 3 insertions, 48 deletions
diff --git a/components/plugins/lib.rs b/components/plugins/lib.rs index d85b167e5d7..3247ad383ed 100644 --- a/components/plugins/lib.rs +++ b/components/plugins/lib.rs @@ -20,8 +20,6 @@ use rustc::plugin::Registry; mod lints; mod macros; -#[cfg(test)] -mod tests; #[plugin_registrar] diff --git a/components/plugins/lints.rs b/components/plugins/lints.rs index 34e73d2475c..4a1bbb85f09 100644 --- a/components/plugins/lints.rs +++ b/components/plugins/lints.rs @@ -1,7 +1,3 @@ -/* 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 http://mozilla.org/MPL/2.0/. */ - use syntax::{ast, codemap, visit}; use syntax::attr::AttrMetaMethods; use rustc::lint::{Context, LintPass, LintArray}; @@ -95,9 +91,9 @@ impl LintPass for UnrootedPass { } } - fn check_fn(&mut self, cx: &Context, kind: &visit::FnKind, decl: &ast::FnDecl, + fn check_fn(&mut self, cx: &Context, kind: visit::FnKind, decl: &ast::FnDecl, block: &ast::Block, _span: codemap::Span, _id: ast::NodeId) { - match *kind { + match kind { visit::FkItemFn(i, _, _, _) | visit::FkMethod(i, _, _) if i.as_str() == "new" || i.as_str() == "new_inherited" => { return; @@ -144,4 +140,4 @@ impl LintPass for UnrootedPass { _ => {} } } -} +}
\ No newline at end of file diff --git a/components/plugins/tests.rs b/components/plugins/tests.rs deleted file mode 100644 index fd78e2038fa..00000000000 --- a/components/plugins/tests.rs +++ /dev/null @@ -1,39 +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 http://mozilla.org/MPL/2.0/. */ - -use std::collections::hashmap::HashMap; - -lazy_init! { - static ref NUMBER: uint = times_two(3); - static ref VEC: [Box<uint>, ..3] = [box 1, box 2, box 3]; - static ref OWNED_STRING: String = "hello".to_string(); - static ref HASHMAP: HashMap<uint, &'static str> = { - let mut m = HashMap::new(); - m.insert(0u, "abc"); - m.insert(1, "def"); - m.insert(2, "ghi"); - m - }; -} - -fn times_two(n: uint) -> uint { - n * 2 -} - -#[test] -fn test_basic() { - assert_eq!(*OWNED_STRING, "hello".to_string()); - assert_eq!(*NUMBER, 6); - assert!(HASHMAP.find(&1).is_some()); - assert!(HASHMAP.find(&3).is_none()); - assert_eq!(VEC.as_slice(), &[box 1, box 2, box 3]); -} - -#[test] -fn test_repeat() { - assert_eq!(*NUMBER, 6); - assert_eq!(*NUMBER, 6); - assert_eq!(*NUMBER, 6); -} - |