Skip to content

Commit

Permalink
Add some necessary tracing commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytm committed Feb 13, 2018
1 parent d07378d commit 4f95269
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/librustc_resolve/resolve_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,11 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
// resolution for it so that later resolve stages won't complain.
self.import_dummy_binding(import);
if !seen_spans.contains(&span) {
info!(
"preparing to import_path_to_string(import={:?}, span={:?})",
import,
span
);
let path = import_path_to_string(&import.module_path[..],
&import.subclass,
span);
Expand Down Expand Up @@ -1015,6 +1020,14 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
fn import_path_to_string(names: &[SpannedIdent],
subclass: &ImportDirectiveSubclass,
span: Span) -> String {
info!(
"import_path_to_string(names={:?} ({:p}/{}), subclass={:?}, span={:?})",
names,
names.as_ptr(),
names.len(),
subclass,
span,
);
let pos = names.iter()
.position(|p| span == p.span && p.node.name != keywords::CrateRoot.name());
let global = !names.is_empty() && names[0].node.name == keywords::CrateRoot.name();
Expand All @@ -1039,11 +1052,12 @@ fn import_path_to_string(names: &[SpannedIdent],
if names.is_empty() || x.starts_with("::") {
span_bug!(
span,
"invalid name `{}` at {:?}; global = {}, names = {:?}, subclass = {:?}",
"invalid name `{}` at {:?}; global = {}, names = {:p}/{}, subclass = {:?}",
x,
span,
global,
names,
names.as_ptr(),
names.len(),
subclass
);
}
Expand Down

0 comments on commit 4f95269

Please sign in to comment.