Shuffle hir-expand things around

This commit is contained in:
Lukas Wirth 2024-01-25 10:07:29 +01:00
parent e320004dad
commit 880baa9e56
8 changed files with 295 additions and 258 deletions

View file

@ -40,7 +40,7 @@ pub enum PathKind {
Crate,
/// Absolute path (::foo)
Abs,
// FIXME: Remove this
// FIXME: Can we remove this somehow?
/// `$crate` from macro expansion
DollarCrate(CrateId),
}
@ -59,7 +59,8 @@ impl ModPath {
}
pub fn from_segments(kind: PathKind, segments: impl IntoIterator<Item = Name>) -> ModPath {
let segments = segments.into_iter().collect();
let mut segments: SmallVec<_> = segments.into_iter().collect();
segments.shrink_to_fit();
ModPath { kind, segments }
}