librustc: Remove unique vector patterns from the language.

Preparatory work for removing unique vectors from the language, which is
itself preparatory work for dynamically sized types.
This commit is contained in:
Patrick Walton 2014-02-13 09:46:46 -08:00
parent ea0058281c
commit 33923f47e3
25 changed files with 229 additions and 198 deletions

View file

@ -647,14 +647,10 @@ impl Visitor<()> for NewNameFinderContext {
&ast::Path {
global: false,
span: _,
segments: [
ast::PathSegment {
identifier: id,
lifetimes: _,
types: _
}
]
} => self.ident_accumulator.push(id),
segments: ref segments
} if segments.len() == 1 => {
self.ident_accumulator.push(segments[0].identifier)
}
// I believe these must be enums...
_ => ()
}
@ -1187,7 +1183,12 @@ foo_module!()
let bindings = name_finder.ident_accumulator;
let cxbinds: ~[&ast::Ident] =
bindings.iter().filter(|b| "xx" == token::get_ident(**b).get()).collect();
bindings.iter().filter(|b| {
let ident = token::get_ident(**b);
let string = ident.get();
"xx" == string
}).collect();
let cxbinds: &[&ast::Ident] = cxbinds;
let cxbind = match cxbinds {
[b] => b,
_ => fail!("expected just one binding for ext_cx")