diff options
| author | Kivooeo <Kivooeo123@gmail.com> | 2025-08-02 23:10:46 +0500 |
|---|---|---|
| committer | Kivooeo <Kivooeo123@gmail.com> | 2025-08-05 01:21:59 +0500 |
| commit | 970ac40300bc75de9f5ef2edf77e93be5bd0769d (patch) | |
| tree | 5cbc0f80d3e45ddc93b294feaaf07cda6b1e8927 | |
| parent | 889701db1ff614160314734fe4138c2f820a95bb (diff) | |
| download | rust-970ac40300bc75de9f5ef2edf77e93be5bd0769d.tar.gz rust-970ac40300bc75de9f5ef2edf77e93be5bd0769d.zip | |
updated doc comment
| -rw-r--r-- | src/librustdoc/clean/types.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 89d5acb985b..cc3faa3d612 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -1534,10 +1534,10 @@ impl Type { matches!(self, Type::Path { path: Path { res: Res::Def(DefKind::TyAlias, _), .. } }) } - /// Check if two types are "the same" for documentation purposes. + /// Check if this type is a subtype of another type for documentation purposes. /// /// This is different from `Eq`, because it knows that things like - /// `Placeholder` are possible matches for everything. + /// `Infer` and generics have special subtyping rules. /// /// This relation is not commutative when generics are involved: /// @@ -1548,8 +1548,8 @@ impl Type { /// let cache = Cache::new(false); /// let generic = Type::Generic(rustc_span::symbol::sym::Any); /// let unit = Type::Primitive(PrimitiveType::Unit); - /// assert!(!generic.is_same(&unit, &cache)); - /// assert!(unit.is_same(&generic, &cache)); + /// assert!(!generic.is_doc_subtype_of(&unit, &cache)); + /// assert!(unit.is_doc_subtype_of(&generic, &cache)); /// ``` /// /// An owned type is also the same as its borrowed variants (this is commutative), |
