pub segments: Vec<Name>,
}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub enum PathKind {
+ Plain,
+ /// `self::` is `Super(0)`
+ Super(u8),
+ Crate,
+ /// Absolute path (::foo)
+ Abs,
+ /// Type based path like `<T>::foo`
+ Type(Box<TypeRef>),
+ /// `$crate` from macro expansion
+ DollarCrate(CrateId),
+}
+
impl ModPath {
pub fn from_src(path: ast::Path, hygiene: &Hygiene) -> Option<ModPath> {
lower::lower_path(path, hygiene).map(|it| it.mod_path)
// or lifetime...
}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub enum PathKind {
- Plain,
- /// `self::` is `Super(0)`
- Super(u8),
- Crate,
- /// Absolute path (::foo)
- Abs,
- /// Type based path like `<T>::foo`
- Type(Box<TypeRef>),
- /// `$crate` from macro expansion
- DollarCrate(CrateId),
-}
-
impl Path {
/// Converts an `ast::Path` to `Path`. Works with use trees.
/// DEPRECATED: It does not handle `$crate` from macro call.