libsyntax/attr.rs: switch from oldmap to LinearSet

This commit is contained in:
Daniel Micay 2013-02-08 20:54:30 -05:00
parent 94fd95a4f1
commit d30fdbb357
1 changed files with 3 additions and 5 deletions

View File

@ -24,8 +24,7 @@ use core::either::Either;
use core::either;
use core::option;
use core::vec;
use std::oldmap::HashMap;
use std::oldmap;
use core::hashmap::linear::LinearSet;
use std;
/* Constructors */
@ -358,16 +357,15 @@ pub fn find_inline_attr(attrs: &[ast::attribute]) -> inline_attr {
pub fn require_unique_names(diagnostic: span_handler,
metas: &[@ast::meta_item]) {
let map = oldmap::HashMap();
let mut set = LinearSet::new();
for metas.each |meta| {
let name = get_meta_item_name(*meta);
// FIXME: How do I silence the warnings? --pcw (#2619)
if map.contains_key(&name) {
if !set.insert(name) {
diagnostic.span_fatal(meta.span,
fmt!("duplicate meta item `%s`", name));
}
map.insert(name, ());
}
}