Skip to content

Commit

Permalink
clarify subtyping
Browse files Browse the repository at this point in the history
  • Loading branch information
Gankra committed Jul 28, 2015
1 parent 9123bb0 commit b539906
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/doc/tarpl/subtyping.md
@@ -1,9 +1,9 @@
% Subtyping and Variance

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

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

0 comments on commit b539906

Please sign in to comment.