Skip to content

Commit 3a96767

Browse files
committedFeb 10, 2018
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.
1 parent 39abcc0 commit 3a96767

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
 

Diff for: ‎src/librustc_resolve/resolve_imports.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -1026,9 +1026,14 @@ fn import_path_to_string(names: &[SpannedIdent],
10261026
if names.is_empty() {
10271027
import_directive_subclass_to_string(subclass)
10281028
} else {
1029-
let x = format!("{}::{}",
1030-
names_to_string(names),
1031-
import_directive_subclass_to_string(subclass));
1029+
// Note that this code looks a little wonky, it's currently here to
1030+
// hopefully help debug #48116, but otherwise isn't intended to
1031+
// cause any problems.
1032+
let x = format!(
1033+
"{}::{}",
1034+
names_to_string(names),
1035+
import_directive_subclass_to_string(subclass),
1036+
);
10321037
assert!(!names.is_empty());
10331038
assert!(!x.starts_with("::"));
10341039
return x

0 commit comments

Comments
 (0)
Please sign in to comment.