]> git.lizzy.rs Git - rust.git/commitdiff
Rustup
authorManish Goregaokar <manishsmail@gmail.com>
Mon, 2 Mar 2015 10:43:44 +0000 (16:13 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Mon, 2 Mar 2015 10:43:44 +0000 (16:13 +0530)
examples/box_vec.rs
examples/dlist.rs
examples/match_if_let.rs
examples/toplevel_ref_arg.rs
src/lib.rs
src/types.rs

index 874b9e8663c7dddf53ab90dc97746c904df5384b..a93b53270bdf1d2fbca6d68f4a5987bafdc09506 100644 (file)
@@ -1,7 +1,6 @@
 #![feature(plugin)]
 
-#[plugin]
-extern crate clippy;
+#![plugin(clippy)]
 
 pub fn test(foo: Box<Vec<bool>>) {
     println!("{:?}", foo.get(0))
index 05b71eabdcc06144bf4b5e4994e6a817bdc57b72..d4c543b8e9f0288f3f9ee07accc3767ea5088ed0 100644 (file)
@@ -1,15 +1,14 @@
 #![feature(plugin)]
 
-#[plugin]
-extern crate clippy;
+#![plugin(clippy)]
 
 extern crate collections;
-use collections::dlist::DList;
+use collections::linked_list::LinkedList;
 
-pub fn test(foo: DList<uint>) {
+pub fn test(foo: LinkedList<uint>) {
     println!("{:?}", foo)
 }
 
 fn main(){
-    test(DList::new());
+    test(LinkedList::new());
 }
\ No newline at end of file
index 5de96dd9951addb9db40629e23448d6e3a6399a5..255bea7d73f21596dd5aa1f118932e13e27041df 100644 (file)
@@ -1,7 +1,6 @@
 #![feature(plugin)]
 
-#[plugin]
-extern crate clippy;
+#![plugin(clippy)]
 
 fn main(){
     let x = Some(1u);
@@ -19,4 +18,4 @@ fn main(){
         (2...3, 7...9) => println!("{:?}", z),
         _ => {}
     }
-}
\ No newline at end of file
+}
index 538e377c74f5ac9c25a9b6fe4f9d678f370f2100..3ebb354142a0b3bee7bf0efd2d1516296a823b94 100644 (file)
@@ -1,7 +1,6 @@
 #![feature(plugin)]
 
-#[plugin]
-extern crate clippy;
+#![plugin(clippy)]
 
 fn the_answer(ref mut x: u8) {
   *x = 42;
index 36802d1a32971334e451977d437ec07f19a859bd..b3f395e5a135c784d425e270785282c30abc6b7e 100644 (file)
@@ -23,7 +23,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
     reg.register_lint_pass(box misc::MiscPass as LintPassObject);
     reg.register_lint_pass(box misc::StrToStringPass as LintPassObject);
     reg.register_lint_pass(box misc::TopLevelRefPass as LintPassObject);
-    reg.register_lint_group("clippy", vec![types::BOX_VEC, types::DLIST,
+    reg.register_lint_group("clippy", vec![types::BOX_VEC, types::LINKEDLIST,
                                            misc::SINGLE_MATCH, misc::STR_TO_STRING,
                                            misc::TOPLEVEL_REF_ARG]);
 }
index 17f030c950ff4c3d0861ec950d86d7b732339a68..dceae401a2e2637c80de975be75f154bfba43d4b 100644 (file)
@@ -12,8 +12,8 @@
 
 declare_lint!(pub BOX_VEC, Warn,
               "Warn on usage of Box<Vec<T>>");
-declare_lint!(pub DLIST, Warn,
-              "Warn on usage of DList");
+declare_lint!(pub LINKEDLIST, Warn,
+              "Warn on usage of LinkedList");
 
 /// Matches a type with a provided string, and returns its type parameters if successful
 pub fn match_ty_unwrap<'a>(ty: &'a Ty, segments: &[&str]) -> Option<&'a [P<Ty>]> {
@@ -48,7 +48,7 @@ pub fn span_note_and_lint(cx: &Context, lint: &'static Lint, span: Span, msg: &s
 
 impl LintPass for TypePass {
     fn get_lints(&self) -> LintArray {
-        lint_array!(BOX_VEC, DLIST)
+        lint_array!(BOX_VEC, LINKEDLIST)
     }
 
     fn check_ty(&mut self, cx: &Context, ty: &ast::Ty) {
@@ -66,17 +66,17 @@ fn check_ty(&mut self, cx: &Context, ty: &ast::Ty) {
           });
         {
             // In case stuff gets moved around
-            use collections::dlist::DList as DL1;
-            use std::collections::dlist::DList as DL2;
-            use std::collections::DList as DL3;
+            use collections::linked_list::LinkedList as DL1;
+            use std::collections::linked_list::LinkedList as DL2;
+            use std::collections::linked_list::LinkedList as DL3;
         }
-        let dlists = [vec!["std","collections","dlist","DList"],
-                      vec!["std","collections","DList"],
-                      vec!["collections","dlist","DList"]];
+        let dlists = [vec!["std","collections","linked_list","LinkedList"],
+                      vec!["std","collections","linked_list","LinkedList"],
+                      vec!["collections","linked_list","LinkedList"]];
         for path in dlists.iter() {
             if match_ty_unwrap(ty, path.as_slice()).is_some() {
-                span_note_and_lint(cx, DLIST, ty.span,
-                                   "I see you're using a DList! Perhaps you meant some other data structure?",
+                span_note_and_lint(cx, LINKEDLIST, ty.span,
+                                   "I see you're using a LinkedList! Perhaps you meant some other data structure?",
                                    "A RingBuf might work.");
                 return;
             }