@@ -69,24 +69,6 @@ declared:
69
69
Here, the constraint ` T:'a ` indicates that the data being iterated
70
70
over must live at least as long as the collection (logically enough).
71
71
72
- ### At most one explicit lifetime bound is permitted
73
-
74
- For simplicity, we permit at most one * explicit* lifetime bound on any
75
- given parameter type. That means that the following function is illegal:
76
-
77
- fn foo<'a,'b,A:'a+'b>() { ... }
78
-
79
- Remember that if there are multiple lifetime bounds, it implies that
80
- all of them must hold. That means that if, in fact, ` A ` outlives both
81
- ` 'a ` and ` 'b ` then either one of them is shorter than the other, the
82
- two are the same, or there is a third lifetime that outlives them
83
- both. Therefore, the function above can be rewritten as follows (using
84
- explicit lifetime bounds, specified below):
85
-
86
- fn foo<'a,'b,'c:'a+'b,A:'c>() { ... }
87
-
88
- As far as I know, this situation has not arisen once in the codebase.
89
-
90
72
## Lifetime bounds on object types
91
73
92
74
Like parameters, all object types have a lifetime bound. Unlike
@@ -113,9 +95,9 @@ Here are some examples:
113
95
// IsStatic+'a 'static+'a
114
96
// IsStatic+Is<'a>+'b 'static,'a,'b
115
97
116
- In general no object type is permitted to have zero bounds. Therefore,
117
- if an object type with no derivable bounds appears, we will supply a
118
- default lifetime using the normal rules:
98
+ Object types must have exactly one bound -- zero bounds is not
99
+ acceptable. Therefore, if an object type with no derivable bounds
100
+ appears, we will supply a default lifetime using the normal rules:
119
101
120
102
trait Writer { /* no derivable bounds */ }
121
103
struct Foo<'a> {
0 commit comments