Skip to content

Commit 97c17e2

Browse files
committed
x fmt
remove some debugs remove format remove debugs remove useless change remove useless change
1 parent 5b5fb4c commit 97c17e2

File tree

5 files changed

+7
-17
lines changed

5 files changed

+7
-17
lines changed

compiler/rustc_interface/src/queries.rs

-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ impl<'tcx> Queries<'tcx> {
121121
}
122122

123123
pub fn parse(&self) -> Result<&Query<ast::Crate>> {
124-
debug!("HELLO THERE");
125124
self.parse.compute(|| {
126125
passes::parse(self.session(), &self.compiler.input)
127126
.map_err(|mut parse_error| parse_error.emit())

compiler/rustc_parse/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ macro_rules! panictry_buffer {
5656
}
5757
}};
5858
}
59+
5960
pub fn parse_crate_from_file<'a>(input: &Path, sess: &'a ParseSess) -> PResult<'a, ast::Crate> {
6061
let mut parser = new_parser_from_file(sess, input, None);
6162
parser.parse_crate_mod()

compiler/rustc_parse/src/parser/diagnostics.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ impl<'a> Parser<'a> {
291291
self.sess.source_map().span_to_snippet(span)
292292
}
293293

294-
#[instrument(level = "debug", skip(self))]
295294
pub(super) fn expected_ident_found(&mut self) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
296295
let valid_follow = &[
297296
TokenKind::Eq,
@@ -343,7 +342,7 @@ impl<'a> Parser<'a> {
343342
// FIXME: shreys what does this look like with invalid generic
344343
// FIXME: shreys - what to do if no snippet? probably just HELP not suggestion
345344
debug!(?generic.span);
346-
345+
347346
match self.sess.source_map().span_to_snippet(generic.span) {
348347
Ok(_snippet) => match self.sess.source_map().span_to_snippet(self.token.span) {
349348
Ok(ident) => {
@@ -353,14 +352,11 @@ impl<'a> Parser<'a> {
353352
format!(" {ident}{_snippet}"),
354353
Applicability::MachineApplicable,
355354
);
356-
}
357-
Err(_) => todo!() //FIXME: shreys - what to do here?
358-
}
355+
}
356+
Err(_) => todo!(), //FIXME: shreys - what to do here?
357+
},
359358
Err(_) => todo!(), //FIXME: shreys - what to do here?
360-
361359
};
362-
363-
364360
});
365361
}
366362

compiler/rustc_parse/src/parser/item.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,11 @@ impl<'a> Parser<'a> {
5959

6060
let post_attr_lo = self.token.span;
6161
let mut items = vec![];
62-
debug!("fails to parse an item!");
6362
while let Some(item) = self.parse_item(ForceCollect::No)? {
6463
items.push(item);
6564
self.maybe_consume_incorrect_semicolon(&items);
6665
}
67-
debug!("Does not make it here!");
66+
6867
if !self.eat(term) {
6968
let token_str = super::token_descr(&self.token);
7069
if !self.maybe_consume_incorrect_semicolon(&items) {
@@ -111,7 +110,6 @@ impl<'a> Parser<'a> {
111110
fn_parse_mode: FnParseMode,
112111
force_collect: ForceCollect,
113112
) -> PResult<'a, Option<Item>> {
114-
debug!("fn parse_item_common");
115113
// Don't use `maybe_whole` so that we have precise control
116114
// over when we bump the parser
117115
if let token::Interpolated(nt) = &self.token.kind && let token::NtItem(item) = &**nt {
@@ -127,10 +125,10 @@ impl<'a> Parser<'a> {
127125
self.collect_tokens_trailing_token(attrs, force_collect, |this: &mut Self, attrs| {
128126
let item =
129127
this.parse_item_common_(attrs, mac_allowed, attrs_allowed, fn_parse_mode);
130-
debug!(?item);
131128
unclosed_delims.append(&mut this.unclosed_delims);
132129
Ok((item?, TrailingToken::None))
133130
})?;
131+
134132
self.unclosed_delims.append(&mut unclosed_delims);
135133
Ok(item)
136134
}
@@ -215,7 +213,6 @@ impl<'a> Parser<'a> {
215213
self.parse_use_item()?
216214
} else if self.check_fn_front_matter(def_final) {
217215
// FUNCTION ITEM
218-
debug!("parse_item_kind: inside fn item");
219216
let (ident, sig, generics, body) = self.parse_fn(attrs, fn_parse_mode, lo, vis)?;
220217
(ident, ItemKind::Fn(Box::new(Fn { defaultness: def(), sig, generics, body })))
221218
} else if self.eat_keyword(kw::Extern) {

compiler/rustc_parse/src/parser/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,6 @@ impl<'a> Parser<'a> {
541541
}
542542

543543
fn ident_or_err(&mut self) -> PResult<'a, (Ident, /* is_raw */ bool)> {
544-
debug!("fn ident_or_err");
545-
debug!(?self.token);
546-
debug!(prev = ?self.prev_token);
547544
self.token.ident().ok_or_else(|| match self.prev_token.kind {
548545
TokenKind::DocComment(..) => DocCommentDoesNotDocumentAnything {
549546
span: self.prev_token.span,

0 commit comments

Comments
 (0)