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 @@ -1552,10 +1552,10 @@ impl Type {
1552
1552
matches ! ( self , Type :: Path { path: Path { res: Res :: Def ( DefKind :: TyAlias , _) , .. } } )
1553
1553
}
1554
1554
1555
- /// Check if two types are "the same" for documentation purposes.
1555
+ /// Check if this type is a subtype of another type for documentation purposes.
1556
1556
///
1557
1557
/// This is different from `Eq`, because it knows that things like
1558
- /// `Placeholder` are possible matches for everything .
1558
+ /// `Infer` and generics have special subtyping rules .
1559
1559
///
1560
1560
/// This relation is not commutative when generics are involved:
1561
1561
///
@@ -1566,8 +1566,8 @@ impl Type {
1566
1566
/// let cache = Cache::new(false);
1567
1567
/// let generic = Type::Generic(rustc_span::symbol::sym::Any);
1568
1568
/// let unit = Type::Primitive(PrimitiveType::Unit);
1569
- /// assert!(!generic.is_same (&unit, &cache));
1570
- /// assert!(unit.is_same (&generic, &cache));
1569
+ /// assert!(!generic.is_doc_subtype_of (&unit, &cache));
1570
+ /// assert!(unit.is_doc_subtype_of (&generic, &cache));
1571
1571
/// ```
1572
1572
///
1573
1573
/// 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