if names.is_empty() {
import_directive_subclass_to_string(subclass)
} else {
- // FIXME: Remove this entire logic after #48116 is fixed.
- //
- // 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),
- );
- if names.is_empty() || x.starts_with("::") {
- span_bug!(
- span,
- "invalid name `{}` at {:?}; global = {}, names = {:?}, subclass = {:?}",
- x,
- span,
- global,
- names,
- subclass
- );
- }
- return x
+ format!("{}::{}",
+ names_to_string(names),
+ import_directive_subclass_to_string(subclass))
}
}
}