From 3a967676f8f9c1d78d493b87c02490d78c5bc0f1 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 10 Feb 2018 07:03:35 -0800 Subject: [PATCH] Explain unusual debugging code in librustc Introduced in #47828 to help track down some bugs, it landed a bit hastily so this is intended on cleaning it up a bit. --- src/librustc_resolve/resolve_imports.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs index 95a507ab9e351..8cb25f449b667 100644 --- a/src/librustc_resolve/resolve_imports.rs +++ b/src/librustc_resolve/resolve_imports.rs @@ -1026,9 +1026,14 @@ fn import_path_to_string(names: &[SpannedIdent], if names.is_empty() { import_directive_subclass_to_string(subclass) } else { - let x = format!("{}::{}", - names_to_string(names), - import_directive_subclass_to_string(subclass)); + // Note that this code looks a little wonky, it's currently here to + // hopefully help debug #48116, but otherwise isn't intended to + // cause any problems. + let x = format!( + "{}::{}", + names_to_string(names), + import_directive_subclass_to_string(subclass), + ); assert!(!names.is_empty()); assert!(!x.starts_with("::")); return x