about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorMichael Darakananda <pongad@gmail.com>2014-03-07 16:15:50 -0500
committerMichael Darakananda <pongad@gmail.com>2014-03-12 19:17:36 -0400
commitf079c94f723f8c67319da8c727324b2011d7b36f (patch)
tree18d17550682a3704d058286fdf4ab0dcf37523be /src/libsyntax/parse
parent3316a0e6b2ad9352bab58e7c046ef3d212411d82 (diff)
downloadrust-f079c94f723f8c67319da8c727324b2011d7b36f.tar.gz
rust-f079c94f723f8c67319da8c727324b2011d7b36f.zip
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.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs19
1 files changed, 1 insertions, 18 deletions
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,