Skip to content

Commit 1e147b4

Browse files
Remove LArrow
1 parent 56d25ba commit 1e147b4

File tree

6 files changed

+5
-24
lines changed

6 files changed

+5
-24
lines changed

compiler/rustc_ast/src/token.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,6 @@ pub enum TokenKind {
274274
ModSep,
275275
/// `->`
276276
RArrow,
277-
/// `<-`
278-
LArrow,
279277
/// `=>`
280278
FatArrow,
281279
/// `#`
@@ -376,7 +374,6 @@ impl TokenKind {
376374
DotDotDot => (Dot, DotDot),
377375
ModSep => (Colon, Colon),
378376
RArrow => (BinOp(Minus), Gt),
379-
LArrow => (Lt, BinOp(Minus)),
380377
FatArrow => (Eq, Gt),
381378
_ => return None,
382379
})
@@ -435,7 +432,7 @@ impl Token {
435432
match self.kind {
436433
Eq | Lt | Le | EqEq | Ne | Ge | Gt | AndAnd | OrOr | Not | Tilde | BinOp(_)
437434
| BinOpEq(_) | At | Dot | DotDot | DotDotDot | DotDotEq | Comma | Semi | Colon
438-
| ModSep | RArrow | LArrow | FatArrow | Pound | Dollar | Question | SingleQuote => true,
435+
| ModSep | RArrow | FatArrow | Pound | Dollar | Question | SingleQuote => true,
439436

440437
OpenDelim(..) | CloseDelim(..) | Literal(..) | DocComment(..) | Ident(..)
441438
| Lifetime(..) | Interpolated(..) | Eof => false,
@@ -780,7 +777,6 @@ impl Token {
780777
Eq => Le,
781778
Lt => BinOp(Shl),
782779
Le => BinOpEq(Shl),
783-
BinOp(Minus) => LArrow,
784780
_ => return None,
785781
},
786782
Gt => match joint.kind {
@@ -820,9 +816,9 @@ impl Token {
820816
},
821817

822818
Le | EqEq | Ne | Ge | AndAnd | OrOr | Tilde | BinOpEq(..) | At | DotDotDot
823-
| DotDotEq | Comma | Semi | ModSep | RArrow | LArrow | FatArrow | Pound | Dollar
824-
| Question | OpenDelim(..) | CloseDelim(..) | Literal(..) | Ident(..)
825-
| Lifetime(..) | Interpolated(..) | DocComment(..) | Eof => return None,
819+
| DotDotEq | Comma | Semi | ModSep | RArrow | FatArrow | Pound | Dollar | Question
820+
| OpenDelim(..) | CloseDelim(..) | Literal(..) | Ident(..) | Lifetime(..)
821+
| Interpolated(..) | DocComment(..) | Eof => return None,
826822
};
827823

828824
Some(Token::new(kind, self.span.to(joint.span)))

compiler/rustc_ast/src/util/parser.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ impl AssocOp {
9494
token::DotDotEq => Some(DotDotEq),
9595
// DotDotDot is no longer supported, but we need some way to display the error
9696
token::DotDotDot => Some(DotDotEq),
97-
// `<-` should probably be `< -`
98-
token::LArrow => Some(Less),
9997
_ if t.is_keyword(kw::As) => Some(As),
10098
_ => None,
10199
}

compiler/rustc_ast_pretty/src/pprust/state.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,6 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
758758
token::Colon => ":".into(),
759759
token::ModSep => "::".into(),
760760
token::RArrow => "->".into(),
761-
token::LArrow => "<-".into(),
762761
token::FatArrow => "=>".into(),
763762
token::OpenDelim(Delimiter::Parenthesis) => "(".into(),
764763
token::CloseDelim(Delimiter::Parenthesis) => ")".into(),

compiler/rustc_expand/src/proc_macro_server.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ impl FromInternal<(TokenStream, &mut Rustc<'_, '_>)> for Vec<TokenTree<TokenStre
195195
Colon => op(":"),
196196
ModSep => op("::"),
197197
RArrow => op("->"),
198-
LArrow => op("<-"),
199198
FatArrow => op("=>"),
200199
Pound => op("#"),
201200
Dollar => op("$"),

compiler/rustc_parse/src/parser/expr.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,6 @@ impl<'a> Parser<'a> {
214214
self.err_dotdotdot_syntax(self.token.span);
215215
}
216216

217-
if self.token == token::LArrow {
218-
self.err_larrow_operator(self.token.span);
219-
}
220-
221217
self.bump();
222218
if op.node.is_comparison() {
223219
if let Some(expr) = self.check_no_chained_comparison(&lhs, &op)? {
@@ -3583,10 +3579,6 @@ impl<'a> Parser<'a> {
35833579
self.sess.emit_err(errors::DotDotDot { span });
35843580
}
35853581

3586-
fn err_larrow_operator(&self, span: Span) {
3587-
self.sess.emit_err(errors::LeftArrowOperator { span });
3588-
}
3589-
35903582
fn mk_assign_op(&self, binop: BinOp, lhs: P<Expr>, rhs: P<Expr>) -> ExprKind {
35913583
ExprKind::AssignOp(binop, lhs, rhs)
35923584
}

compiler/rustc_parse/src/parser/path.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,7 @@ impl<'a> Parser<'a> {
272272
let is_args_start = |token: &Token| {
273273
matches!(
274274
token.kind,
275-
token::Lt
276-
| token::BinOp(token::Shl)
277-
| token::OpenDelim(Delimiter::Parenthesis)
278-
| token::LArrow
275+
token::Lt | token::BinOp(token::Shl) | token::OpenDelim(Delimiter::Parenthesis)
279276
)
280277
};
281278
let check_args_start = |this: &mut Self| {

0 commit comments

Comments
 (0)