Add some more tracing
This commit is contained in:
parent
38e576423d
commit
4281380717
5 changed files with 13 additions and 3 deletions
|
@ -13,9 +13,11 @@
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate rustc_macros;
|
extern crate rustc_macros;
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate tracing;
|
||||||
|
|
||||||
pub use emitter::ColorConfig;
|
pub use emitter::ColorConfig;
|
||||||
|
|
||||||
use tracing::debug;
|
|
||||||
use Level::*;
|
use Level::*;
|
||||||
|
|
||||||
use emitter::{is_case_difference, Emitter, EmitterWriter};
|
use emitter::{is_case_difference, Emitter, EmitterWriter};
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
#![feature(box_patterns)]
|
#![feature(box_patterns)]
|
||||||
#![recursion_limit = "256"]
|
#![recursion_limit = "256"]
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate tracing;
|
||||||
|
|
||||||
use rustc_ast as ast;
|
use rustc_ast as ast;
|
||||||
use rustc_ast::token::{self, Nonterminal, Token, TokenKind};
|
use rustc_ast::token::{self, Nonterminal, Token, TokenKind};
|
||||||
use rustc_ast::tokenstream::{self, AttributesData, CanSynthesizeMissingTokens, LazyTokenStream};
|
use rustc_ast::tokenstream::{self, AttributesData, CanSynthesizeMissingTokens, LazyTokenStream};
|
||||||
|
|
|
@ -1084,6 +1084,7 @@ impl<'a> Parser<'a> {
|
||||||
|
|
||||||
/// If we encounter a parser state that looks like the user has written a `struct` literal with
|
/// If we encounter a parser state that looks like the user has written a `struct` literal with
|
||||||
/// parentheses instead of braces, recover the parser state and provide suggestions.
|
/// parentheses instead of braces, recover the parser state and provide suggestions.
|
||||||
|
#[instrument(skip(self, seq, snapshot), level = "trace")]
|
||||||
fn maybe_recover_struct_lit_bad_delims(
|
fn maybe_recover_struct_lit_bad_delims(
|
||||||
&mut self,
|
&mut self,
|
||||||
lo: Span,
|
lo: Span,
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate rustc_macros;
|
extern crate rustc_macros;
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate tracing;
|
||||||
|
|
||||||
use rustc_data_structures::AtomicRef;
|
use rustc_data_structures::AtomicRef;
|
||||||
use rustc_macros::HashStable_Generic;
|
use rustc_macros::HashStable_Generic;
|
||||||
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
|
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
|
||||||
|
|
|
@ -474,11 +474,12 @@ impl SourceMap {
|
||||||
f.lookup_line(sp.lo()) != f.lookup_line(sp.hi())
|
f.lookup_line(sp.lo()) != f.lookup_line(sp.hi())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[instrument(skip(self), level = "trace")]
|
||||||
pub fn is_valid_span(&self, sp: Span) -> Result<(Loc, Loc), SpanLinesError> {
|
pub fn is_valid_span(&self, sp: Span) -> Result<(Loc, Loc), SpanLinesError> {
|
||||||
let lo = self.lookup_char_pos(sp.lo());
|
let lo = self.lookup_char_pos(sp.lo());
|
||||||
debug!("span_to_lines: lo={:?}", lo);
|
trace!(?lo);
|
||||||
let hi = self.lookup_char_pos(sp.hi());
|
let hi = self.lookup_char_pos(sp.hi());
|
||||||
debug!("span_to_lines: hi={:?}", hi);
|
trace!(?hi);
|
||||||
if lo.file.start_pos != hi.file.start_pos {
|
if lo.file.start_pos != hi.file.start_pos {
|
||||||
return Err(SpanLinesError::DistinctSources(DistinctSources {
|
return Err(SpanLinesError::DistinctSources(DistinctSources {
|
||||||
begin: (lo.file.name.clone(), lo.file.start_pos),
|
begin: (lo.file.name.clone(), lo.file.start_pos),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue