librustc: Remove ~"string"
and &"string"
from the language
This commit is contained in:
parent
a3f9f37014
commit
4baff4e15f
11 changed files with 58 additions and 72 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue