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.
This commit is contained in:
parent
3316a0e6b2
commit
f079c94f72
17 changed files with 57 additions and 110 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue