about summary refs log tree commit diff
path: root/src/libsyntax/attr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/attr.rs')
-rw-r--r--src/libsyntax/attr.rs18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs
index e096711262f..a1a0c700628 100644
--- a/src/libsyntax/attr.rs
+++ b/src/libsyntax/attr.rs
@@ -10,7 +10,7 @@
 
 // Functions dealing with attributes and meta_items
 
-use core::prelude::*;
+use extra;
 
 use ast;
 use codemap::{spanned, dummy_spanned};
@@ -19,10 +19,8 @@ use codemap::BytePos;
 use diagnostic::span_handler;
 use parse::comments::{doc_comment_style, strip_doc_comment_decoration};
 
-use core::hashmap::HashSet;
-use core::vec;
-use extra;
-
+use std::hashmap::HashSet;
+use std::vec;
 /* Constructors */
 
 pub fn mk_name_value_item_str(name: @str, value: @str)
@@ -158,7 +156,7 @@ pub fn find_attrs_by_name(attrs: &[ast::attribute], name: &str) ->
 pub fn find_meta_items_by_name(metas: &[@ast::meta_item], name: &str) ->
    ~[@ast::meta_item] {
     let mut rs = ~[];
-    for metas.each |mi| {
+    for metas.iter().advance |mi| {
         if name == get_meta_item_name(*mi) {
             rs.push(*mi)
         }
@@ -172,7 +170,7 @@ pub fn find_meta_items_by_name(metas: &[@ast::meta_item], name: &str) ->
  */
 pub fn contains(haystack: &[@ast::meta_item],
                 needle: @ast::meta_item) -> bool {
-    for haystack.each |item| {
+    for haystack.iter().advance |item| {
         if eq(*item, needle) { return true; }
     }
     return false;
@@ -193,8 +191,8 @@ fn eq(a: @ast::meta_item, b: @ast::meta_item) -> bool {
         ast::meta_list(ref na, ref misa) => match b.node {
             ast::meta_list(ref nb, ref misb) => {
                 if na != nb { return false; }
-                for misa.each |mi| {
-                    if !misb.contains(mi) { return false; }
+                for misa.iter().advance |mi| {
+                    if !misb.iter().any_(|x| x == mi) { return false; }
                 }
                 true
             }
@@ -334,7 +332,7 @@ pub fn find_inline_attr(attrs: &[ast::attribute]) -> inline_attr {
 pub fn require_unique_names(diagnostic: @span_handler,
                             metas: &[@ast::meta_item]) {
     let mut set = HashSet::new();
-    for metas.each |meta| {
+    for metas.iter().advance |meta| {
         let name = get_meta_item_name(*meta);
 
         // FIXME: How do I silence the warnings? --pcw (#2619)