Skip to content

Commit 485a4da

Browse files
committed
clean up debug code
1 parent 56dc116 commit 485a4da

File tree

5 files changed

+5
-21
lines changed

5 files changed

+5
-21
lines changed

compiler/rustc_parse/src/parser/diagnostics.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,21 +1723,13 @@ impl<'a> Parser<'a> {
17231723
lo: Span,
17241724
result: PResult<'a, P<Expr>>,
17251725
) -> P<Expr> {
1726-
use crate::parser::DUMMY_NODE_ID;
17271726
match result {
17281727
Ok(x) => x,
17291728
Err(mut err) => {
17301729
err.emit();
17311730
// Recover from parse error, callers expect the closing delim to be consumed.
17321731
self.consume_block(delim, ConsumeClosingDelim::Yes);
1733-
debug!("recover_seq_parse_error: consumed tokens until {:?} {:?}", lo, self.token);
1734-
let res = self.mk_expr(lo.to(self.prev_token.span), ExprKind::Err);
1735-
if res.id == DUMMY_NODE_ID {
1736-
//panic!("debug now ....: {:?}", res);
1737-
res
1738-
} else {
1739-
res
1740-
}
1732+
self.mk_expr(lo.to(self.prev_token.span), ExprKind::Err)
17411733
}
17421734
}
17431735
}
@@ -1819,7 +1811,6 @@ impl<'a> Parser<'a> {
18191811
&& brace_depth == 0
18201812
&& bracket_depth == 0 =>
18211813
{
1822-
debug!("recover_stmt_ return - Comma");
18231814
break;
18241815
}
18251816
_ => self.bump(),

compiler/rustc_parse/src/parser/path.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,6 @@ impl<'a> Parser<'a> {
205205
segments.push(PathSegment::path_root(lo.shrink_to_lo().with_ctxt(mod_sep_ctxt)));
206206
}
207207
self.parse_path_segments(&mut segments, style, ty_generics)?;
208-
if segments.len() > 1 {
209-
//panic!("debug now ...");
210-
}
211208
Ok(Path { segments, span: lo.to(self.prev_token.span), tokens: None })
212209
}
213210

@@ -727,7 +724,6 @@ impl<'a> Parser<'a> {
727724
&mut self,
728725
ty_generics: Option<&Generics>,
729726
) -> PResult<'a, Option<GenericArg>> {
730-
debug!("pain");
731727
let start = self.token.span;
732728
let arg = if self.check_lifetime() && self.look_ahead(1, |t| !t.is_like_plus()) {
733729
// Parse lifetime argument.
@@ -736,7 +732,6 @@ impl<'a> Parser<'a> {
736732
// Parse const argument.
737733
GenericArg::Const(self.parse_const_arg()?)
738734
} else if self.check_type() {
739-
debug!("type");
740735
// Parse type argument.
741736

742737
// Proactively create a parser snapshot enabling us to rewind and try to reparse the

compiler/rustc_resolve/src/diagnostics.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -775,10 +775,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
775775
.sess
776776
.create_err(errs::SelfImportOnlyInImportListWithNonEmptyPrefix { span }),
777777
ResolutionError::FailedToResolve { label, suggestion } => {
778-
if label.len() > 0 {
779-
//panic!("debug now");
780-
}
781-
782778
let mut err =
783779
struct_span_err!(self.tcx.sess, span, E0433, "failed to resolve: {}", &label);
784780
err.span_label(span, label);

compiler/rustc_resolve/src/late.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3710,14 +3710,17 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
37103710
}
37113711

37123712
/// Handles paths that may refer to associated items.
3713-
#[instrument(level = "debug", skip(self))]
37143713
fn resolve_qpath(
37153714
&mut self,
37163715
qself: &Option<P<QSelf>>,
37173716
path: &[Segment],
37183717
ns: Namespace,
37193718
finalize: Finalize,
37203719
) -> Result<Option<PartialRes>, Spanned<ResolutionError<'a>>> {
3720+
debug!(
3721+
"resolve_qpath(qself={:?}, path={:?}, ns={:?}, finalize={:?})",
3722+
qself, path, ns, finalize,
3723+
);
37213724
if let Some(qself) = qself {
37223725
if qself.position == 0 {
37233726
// This is a case like `<T>::B`, where there is no

compiler/rustc_resolve/src/late/diagnostics.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
305305

306306
/// Handles error reporting for `smart_resolve_path_fragment` function.
307307
/// Creates base error and amends it with one short label and possibly some longer helps/notes.
308-
#[instrument(level = "debug", skip(self))]
309308
pub(crate) fn smart_resolve_report_errors(
310309
&mut self,
311310
path: &[Segment],

0 commit comments

Comments
 (0)