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 1
1
% Subtyping and Variance
2
2
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.
7
7
8
8
Subtyping on lifetimes in terms of that relationship: if ` 'a: 'b ` ("a contains
9
9
b" or "a outlives b"), then ` 'a ` is a subtype of ` 'b ` . This is a large source of
You can’t perform that action at this time.
0 commit comments