Skip to content

Commit b539906

Browse files
committed
clarify subtyping
1 parent 9123bb0 commit b539906

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/doc/tarpl/subtyping.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
% Subtyping and Variance
22

3-
Although Rust doesn't have any notion of inheritance, it *does* include
4-
subtyping. In Rust, subtyping derives entirely from *lifetimes*. Since lifetimes
5-
are scopes, we can partially order them based on the *contains* (outlives)
6-
relationship. We can even express this as a generic bound.
3+
Although Rust doesn't have any notion of structural inheritance, it *does*
4+
include subtyping. In Rust, subtyping derives entirely from *lifetimes*. Since
5+
lifetimes are scopes, we can partially order them based on the *contains*
6+
(outlives) relationship. We can even express this as a generic bound.
77

88
Subtyping on lifetimes in terms of that relationship: if `'a: 'b` ("a contains
99
b" or "a outlives b"), then `'a` is a subtype of `'b`. This is a large source of

0 commit comments

Comments
 (0)