Skip to content

Commit 970ac40

Browse files
committed
updated doc comment
1 parent 889701d commit 970ac40

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustdoc/clean/types.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,10 +1534,10 @@ impl Type {
15341534
matches!(self, Type::Path { path: Path { res: Res::Def(DefKind::TyAlias, _), .. } })
15351535
}
15361536

1537-
/// Check if two types are "the same" for documentation purposes.
1537+
/// Check if this type is a subtype of another type for documentation purposes.
15381538
///
15391539
/// This is different from `Eq`, because it knows that things like
1540-
/// `Placeholder` are possible matches for everything.
1540+
/// `Infer` and generics have special subtyping rules.
15411541
///
15421542
/// This relation is not commutative when generics are involved:
15431543
///
@@ -1548,8 +1548,8 @@ impl Type {
15481548
/// let cache = Cache::new(false);
15491549
/// let generic = Type::Generic(rustc_span::symbol::sym::Any);
15501550
/// let unit = Type::Primitive(PrimitiveType::Unit);
1551-
/// assert!(!generic.is_same(&unit, &cache));
1552-
/// assert!(unit.is_same(&generic, &cache));
1551+
/// assert!(!generic.is_doc_subtype_of(&unit, &cache));
1552+
/// assert!(unit.is_doc_subtype_of(&generic, &cache));
15531553
/// ```
15541554
///
15551555
/// An owned type is also the same as its borrowed variants (this is commutative),

0 commit comments

Comments
 (0)