Skip to content

Commit d30fdbb

Browse files
committed
libsyntax/attr.rs: switch from oldmap to LinearSet
1 parent 94fd95a commit d30fdbb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/libsyntax/attr.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ use core::either::Either;
2424
use core::either;
2525
use core::option;
2626
use core::vec;
27-
use std::oldmap::HashMap;
28-
use std::oldmap;
27+
use core::hashmap::linear::LinearSet;
2928
use std;
3029

3130
/* Constructors */
@@ -358,16 +357,15 @@ pub fn find_inline_attr(attrs: &[ast::attribute]) -> inline_attr {
358357
359358
pub fn require_unique_names(diagnostic: span_handler,
360359
metas: &[@ast::meta_item]) {
361-
let map = oldmap::HashMap();
360+
let mut set = LinearSet::new();
362361
for metas.each |meta| {
363362
let name = get_meta_item_name(*meta);
364363
365364
// FIXME: How do I silence the warnings? --pcw (#2619)
366-
if map.contains_key(&name) {
365+
if !set.insert(name) {
367366
diagnostic.span_fatal(meta.span,
368367
fmt!("duplicate meta item `%s`", name));
369368
}
370-
map.insert(name, ());
371369
}
372370
}
373371

0 commit comments

Comments
 (0)