Skip to content

Commit bc9877c

Browse files
committed
Undo debug statements
1 parent ce9e765 commit bc9877c

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

compiler/rustc_parse/src/parser/expr.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ use rustc_span::symbol::{kw, sym, Ident, Symbol};
2323
use rustc_span::{BytePos, Pos};
2424
use std::mem;
2525

26-
use tracing::debug;
27-
2826
/// Possibly accepts an `token::Interpolated` expression (a pre-parsed expression
2927
/// dropped into the token stream, which happens while parsing the result of
3028
/// macro expansion). Placement of these is not as complex as I feared it would
@@ -165,24 +163,18 @@ impl<'a> Parser<'a> {
165163
if [token::DotDot, token::DotDotDot, token::DotDotEq].contains(&self.token.kind) {
166164
return self.parse_prefix_range_expr(attrs);
167165
} else {
168-
let result = self.parse_prefix_expr(attrs);
169-
debug!("parse_prefix_expr result: {:?}", &result);
170-
result?
166+
self.parse_prefix_expr(attrs)?
171167
}
172168
};
173-
debug!("parse_assoc_expr_with(lhs = {:?})", &lhs);
174169
let last_type_ascription_set = self.last_type_ascription.is_some();
175170

176171
if !self.should_continue_as_assoc_expr(&lhs) {
177172
self.last_type_ascription = None;
178173
return Ok(lhs);
179174
}
180175

181-
debug!("continue_as_assoc_expr");
182-
183176
self.expected_tokens.push(TokenType::Operator);
184177
while let Some(op) = self.check_assoc_op() {
185-
debug!("op: {:?}", op);
186178
// Adjust the span for interpolated LHS to point to the `$lhs` token
187179
// and not to what it refers to.
188180
let lhs_span = match self.prev_token.kind {
@@ -363,7 +355,6 @@ impl<'a> Parser<'a> {
363355
/// but the next token implies this should be parsed as an expression.
364356
/// For example: `if let Some(x) = x { x } else { 0 } / 2`.
365357
fn error_found_expr_would_be_stmt(&self, lhs: &Expr) {
366-
debug!("error_found_expr_would_be_stmt(lhs: {:?})", lhs);
367358
let mut err = self.struct_span_err(
368359
self.token.span,
369360
&format!("expected expression, found `{}`", pprust::token_to_string(&self.token),),
@@ -526,7 +517,6 @@ impl<'a> Parser<'a> {
526517
make_it!(this, attrs, |this, _| this.parse_borrow_expr(lo))
527518
}
528519
token::BinOp(token::Plus) => {
529-
debug!("leading + detected: {:?}", lo);
530520
let mut err = this.struct_span_err(lo, "leading `+` is not supported");
531521
err.span_label(lo, "unexpected `+`");
532522

compiler/rustc_parse/src/parser/stmt.rs

-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ use rustc_span::symbol::{kw, sym};
2121

2222
use std::mem;
2323

24-
use tracing::debug;
25-
2624
impl<'a> Parser<'a> {
2725
/// Parses a statement. This stops just before trailing semicolons on everything but items.
2826
/// e.g., a `StmtKind::Semi` parses to a `StmtKind::Expr`, leaving the trailing `;` unconsumed.
@@ -420,7 +418,6 @@ impl<'a> Parser<'a> {
420418
if self.token == token::Eof {
421419
break;
422420
}
423-
debug!("parsing statements, stmts: {:?}", &stmts);
424421
let stmt = match self.parse_full_stmt(recover) {
425422
Err(mut err) if recover.yes() => {
426423
self.maybe_annotate_with_ascription(&mut err, false);

0 commit comments

Comments
 (0)