File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1534,10 +1534,10 @@ impl Type {
1534
1534
matches ! ( self , Type :: Path { path: Path { res: Res :: Def ( DefKind :: TyAlias , _) , .. } } )
1535
1535
}
1536
1536
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.
1538
1538
///
1539
1539
/// 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 .
1541
1541
///
1542
1542
/// This relation is not commutative when generics are involved:
1543
1543
///
@@ -1548,8 +1548,8 @@ impl Type {
1548
1548
/// let cache = Cache::new(false);
1549
1549
/// let generic = Type::Generic(rustc_span::symbol::sym::Any);
1550
1550
/// 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));
1553
1553
/// ```
1554
1554
///
1555
1555
/// An owned type is also the same as its borrowed variants (this is commutative),
You can’t perform that action at this time.
0 commit comments