diff options
| author | yukang <moorekang@gmail.com> | 2023-03-14 23:48:33 +0800 |
|---|---|---|
| committer | yukang <moorekang@gmail.com> | 2023-05-01 16:15:17 +0800 |
| commit | 1b08eaca200ea5c7f6455b0302e031b479fb33dc (patch) | |
| tree | 650c48bb6f2cff09acc63aaa817d7c6c1ae49d94 /compiler/rustc_parse/src/parser | |
| parent | 10512b2932ba91ddde1ab92c6bb9662f751092c3 (diff) | |
| download | rust-1b08eaca200ea5c7f6455b0302e031b479fb33dc.tar.gz rust-1b08eaca200ea5c7f6455b0302e031b479fb33dc.zip | |
clean up debug code
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 11 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/path.rs | 5 |
2 files changed, 1 insertions, 15 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index bcc76c20815..aad7d21e1b4 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -1775,21 +1775,13 @@ impl<'a> Parser<'a> { lo: Span, result: PResult<'a, P<Expr>>, ) -> P<Expr> { - use crate::parser::DUMMY_NODE_ID; match result { Ok(x) => x, Err(mut err) => { err.emit(); // Recover from parse error, callers expect the closing delim to be consumed. self.consume_block(delim, ConsumeClosingDelim::Yes); - debug!("recover_seq_parse_error: consumed tokens until {:?} {:?}", lo, self.token); - let res = self.mk_expr(lo.to(self.prev_token.span), ExprKind::Err); - if res.id == DUMMY_NODE_ID { - //panic!("debug now ....: {:?}", res); - res - } else { - res - } + self.mk_expr(lo.to(self.prev_token.span), ExprKind::Err) } } } @@ -1871,7 +1863,6 @@ impl<'a> Parser<'a> { && brace_depth == 0 && bracket_depth == 0 => { - debug!("recover_stmt_ return - Comma"); break; } _ => self.bump(), diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs index 323588c4ff5..950efc2a9fc 100644 --- a/compiler/rustc_parse/src/parser/path.rs +++ b/compiler/rustc_parse/src/parser/path.rs @@ -202,9 +202,6 @@ impl<'a> Parser<'a> { segments.push(PathSegment::path_root(lo.shrink_to_lo().with_ctxt(mod_sep_ctxt))); } self.parse_path_segments(&mut segments, style, ty_generics)?; - if segments.len() > 1 { - //panic!("debug now ..."); - } Ok(Path { segments, span: lo.to(self.prev_token.span), tokens: None }) } @@ -740,7 +737,6 @@ impl<'a> Parser<'a> { &mut self, ty_generics: Option<&Generics>, ) -> PResult<'a, Option<GenericArg>> { - debug!("pain"); let start = self.token.span; let arg = if self.check_lifetime() && self.look_ahead(1, |t| !t.is_like_plus()) { // Parse lifetime argument. @@ -749,7 +745,6 @@ impl<'a> Parser<'a> { // Parse const argument. GenericArg::Const(self.parse_const_arg()?) } else if self.check_type() { - debug!("type"); // Parse type argument. // Proactively create a parser snapshot enabling us to rewind and try to reparse the |
