Skip to content

Commit 1b08eac

Browse files
committed
clean up debug code
1 parent 10512b2 commit 1b08eac

File tree

5 files changed

+5
-21
lines changed

5 files changed

+5
-21
lines changed

compiler/rustc_parse/src/parser/diagnostics.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -1775,21 +1775,13 @@ impl<'a> Parser<'a> {
17751775
lo: Span,
17761776
result: PResult<'a, P<Expr>>,
17771777
) -> P<Expr> {
1778-
use crate::parser::DUMMY_NODE_ID;
17791778
match result {
17801779
Ok(x) => x,
17811780
Err(mut err) => {
17821781
err.emit();
17831782
// Recover from parse error, callers expect the closing delim to be consumed.
17841783
self.consume_block(delim, ConsumeClosingDelim::Yes);
1785-
debug!("recover_seq_parse_error: consumed tokens until {:?} {:?}", lo, self.token);
1786-
let res = self.mk_expr(lo.to(self.prev_token.span), ExprKind::Err);
1787-
if res.id == DUMMY_NODE_ID {
1788-
//panic!("debug now ....: {:?}", res);
1789-
res
1790-
} else {
1791-
res
1792-
}
1784+
self.mk_expr(lo.to(self.prev_token.span), ExprKind::Err)
17931785
}
17941786
}
17951787
}
@@ -1871,7 +1863,6 @@ impl<'a> Parser<'a> {
18711863
&& brace_depth == 0
18721864
&& bracket_depth == 0 =>
18731865
{
1874-
debug!("recover_stmt_ return - Comma");
18751866
break;
18761867
}
18771868
_ => self.bump(),

compiler/rustc_parse/src/parser/path.rs

-5
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,6 @@ impl<'a> Parser<'a> {
202202
segments.push(PathSegment::path_root(lo.shrink_to_lo().with_ctxt(mod_sep_ctxt)));
203203
}
204204
self.parse_path_segments(&mut segments, style, ty_generics)?;
205-
if segments.len() > 1 {
206-
//panic!("debug now ...");
207-
}
208205
Ok(Path { segments, span: lo.to(self.prev_token.span), tokens: None })
209206
}
210207

@@ -740,7 +737,6 @@ impl<'a> Parser<'a> {
740737
&mut self,
741738
ty_generics: Option<&Generics>,
742739
) -> PResult<'a, Option<GenericArg>> {
743-
debug!("pain");
744740
let start = self.token.span;
745741
let arg = if self.check_lifetime() && self.look_ahead(1, |t| !t.is_like_plus()) {
746742
// Parse lifetime argument.
@@ -749,7 +745,6 @@ impl<'a> Parser<'a> {
749745
// Parse const argument.
750746
GenericArg::Const(self.parse_const_arg()?)
751747
} else if self.check_type() {
752-
debug!("type");
753748
// Parse type argument.
754749

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

compiler/rustc_resolve/src/diagnostics.rs

-4
Original file line numberDiff line numberDiff line change
@@ -777,10 +777,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
777777
.sess
778778
.create_err(errs::SelfImportOnlyInImportListWithNonEmptyPrefix { span }),
779779
ResolutionError::FailedToResolve { label, suggestion } => {
780-
if label.len() > 0 {
781-
//panic!("debug now");
782-
}
783-
784780
let mut err =
785781
struct_span_err!(self.tcx.sess, span, E0433, "failed to resolve: {}", &label);
786782
err.span_label(span, label);

compiler/rustc_resolve/src/late.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -3715,14 +3715,17 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
37153715
}
37163716

37173717
/// Handles paths that may refer to associated items.
3718-
#[instrument(level = "debug", skip(self))]
37193718
fn resolve_qpath(
37203719
&mut self,
37213720
qself: &Option<P<QSelf>>,
37223721
path: &[Segment],
37233722
ns: Namespace,
37243723
finalize: Finalize,
37253724
) -> Result<Option<PartialRes>, Spanned<ResolutionError<'a>>> {
3725+
debug!(
3726+
"resolve_qpath(qself={:?}, path={:?}, ns={:?}, finalize={:?})",
3727+
qself, path, ns, finalize,
3728+
);
37263729
if let Some(qself) = qself {
37273730
if qself.position == 0 {
37283731
// This is a case like `<T>::B`, where there is no

compiler/rustc_resolve/src/late/diagnostics.rs

-1
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)