diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-04-30 16:49:12 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-04-30 16:49:12 -0700 |
| commit | 4baff4e15f003260de0cc17f419c418332e77149 (patch) | |
| tree | 0946dec00c29f67e175970eb1792103e0a2e568d /src/libsyntax/parse | |
| parent | a3f9f37014c77cda1ae53bf0984190e877aa413a (diff) | |
| download | rust-4baff4e15f003260de0cc17f419c418332e77149.tar.gz rust-4baff4e15f003260de0cc17f419c418332e77149.zip | |
librustc: Remove `~"string"` and `&"string"` from the language
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 8e6d6719bb9..5d8443b64d5 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2779,28 +2779,11 @@ impl<'a> Parser<'a> { } } token::BINOP(token::AND) | token::ANDAND => { - // parse &pat - let lo = self.span.lo; - self.expect_and(); - let sub = self.parse_pat(); - hi = sub.span.hi; - // HACK: parse &"..." as a literal of a borrowed 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, ExprVstoreSlice), - span: mk_sp(lo, hi) - }; - PatLit(vst) - } - _ => PatRegion(sub), - } - } - _ => PatRegion(sub), - }; + // parse &pat + let lo = self.span.lo; + self.expect_and(); + let sub = self.parse_pat(); + pat = PatRegion(sub); hi = self.last_span.hi; return @ast::Pat { id: ast::DUMMY_NODE_ID, |
