From f079c94f723f8c67319da8c727324b2011d7b36f Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Fri, 7 Mar 2014 16:15:50 -0500 Subject: rustc: Remove matching on ~str from the language The `~str` type is not long for this world as it will be superseded by the soon-to-come DST changes for the language. The new type will be `~Str`, and matching over the allocation will no longer be supported. Matching on `&str` will continue to work, in both a pre and post DST world. --- src/libsyntax/parse/parser.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 7760ca89eb2..676db94cd7c 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2838,24 +2838,7 @@ impl Parser { // parse ~pat self.bump(); let sub = self.parse_pat(); - hi = sub.span.hi; - // HACK: parse ~"..." as a literal of a vstore ~str - pat = match sub.node { - PatLit(e) => { - match e.node { - ExprLit(lit) if lit_is_str(lit) => { - let vst = @Expr { - id: ast::DUMMY_NODE_ID, - node: ExprVstore(e, ExprVstoreUniq), - span: mk_sp(lo, hi), - }; - PatLit(vst) - } - _ => PatUniq(sub) - } - } - _ => PatUniq(sub) - }; + pat = PatUniq(sub); hi = self.last_span.hi; return @ast::Pat { id: ast::DUMMY_NODE_ID, -- cgit 1.4.1-3-g733a5