Skip to content

Commit 4281380

Browse files
committed
Add some more tracing
1 parent 38e5764 commit 4281380

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

compiler/rustc_errors/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
#[macro_use]
1414
extern crate rustc_macros;
1515

16+
#[macro_use]
17+
extern crate tracing;
18+
1619
pub use emitter::ColorConfig;
1720

18-
use tracing::debug;
1921
use Level::*;
2022

2123
use emitter::{is_case_difference, Emitter, EmitterWriter};

compiler/rustc_parse/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#![feature(box_patterns)]
77
#![recursion_limit = "256"]
88

9+
#[macro_use]
10+
extern crate tracing;
11+
912
use rustc_ast as ast;
1013
use rustc_ast::token::{self, Nonterminal, Token, TokenKind};
1114
use rustc_ast::tokenstream::{self, AttributesData, CanSynthesizeMissingTokens, LazyTokenStream};

compiler/rustc_parse/src/parser/expr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,7 @@ impl<'a> Parser<'a> {
10841084

10851085
/// If we encounter a parser state that looks like the user has written a `struct` literal with
10861086
/// parentheses instead of braces, recover the parser state and provide suggestions.
1087+
#[instrument(skip(self, seq, snapshot), level = "trace")]
10871088
fn maybe_recover_struct_lit_bad_delims(
10881089
&mut self,
10891090
lo: Span,

compiler/rustc_span/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
#[macro_use]
2626
extern crate rustc_macros;
2727

28+
#[macro_use]
29+
extern crate tracing;
30+
2831
use rustc_data_structures::AtomicRef;
2932
use rustc_macros::HashStable_Generic;
3033
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};

compiler/rustc_span/src/source_map.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,12 @@ impl SourceMap {
474474
f.lookup_line(sp.lo()) != f.lookup_line(sp.hi())
475475
}
476476

477+
#[instrument(skip(self), level = "trace")]
477478
pub fn is_valid_span(&self, sp: Span) -> Result<(Loc, Loc), SpanLinesError> {
478479
let lo = self.lookup_char_pos(sp.lo());
479-
debug!("span_to_lines: lo={:?}", lo);
480+
trace!(?lo);
480481
let hi = self.lookup_char_pos(sp.hi());
481-
debug!("span_to_lines: hi={:?}", hi);
482+
trace!(?hi);
482483
if lo.file.start_pos != hi.file.start_pos {
483484
return Err(SpanLinesError::DistinctSources(DistinctSources {
484485
begin: (lo.file.name.clone(), lo.file.start_pos),

0 commit comments

Comments
 (0)