diff options
| author | Noah Lev <camelidcamel@gmail.com> | 2021-09-25 09:50:12 -0700 |
|---|---|---|
| committer | Noah Lev <camelidcamel@gmail.com> | 2021-09-25 09:50:12 -0700 |
| commit | dace2ee674da9550618563babe351f313ede799d (patch) | |
| tree | 34b967add55936221c3eedbe5e2da6fa51f613ee /src | |
| parent | 1085dc2148594bc259f9629b7ca4aa9489c8c10d (diff) | |
| download | rust-dace2ee674da9550618563babe351f313ede799d.tar.gz rust-dace2ee674da9550618563babe351f313ede799d.zip | |
rustdoc: Document `is_assoc_ty()`
It's adapted from the old documentation for the `is_generic` field.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/types.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 0139c4e879a..986729dd044 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -1498,6 +1498,7 @@ impl Type { } } + /// Checks if this is a `T::Name` path for an associated type. crate fn is_assoc_ty(&self) -> bool { match self { ResolvedPath { path, .. } => path.is_assoc_ty(), @@ -1990,6 +1991,7 @@ impl Path { + &self.segments.iter().map(|s| s.name.to_string()).collect::<Vec<_>>().join("::") } + /// Checks if this is a `T::Name` path for an associated type. crate fn is_assoc_ty(&self) -> bool { match self.res { Res::SelfTy(..) if self.segments.len() != 1 => true, |
