1 error: lifetime may not live long enough
2 --> $DIR/variance-btree-invariant-types.rs:4:5
4 LL | fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, &'new (), ()> {
5 | ---- lifetime `'new` defined here
7 | ^ returning this value requires that `'new` must outlive `'static`
9 = note: requirement occurs because of the type `std::collections::btree_map::IterMut<'_, &(), ()>`, which makes the generic argument `&()` invariant
10 = note: the struct `std::collections::btree_map::IterMut<'a, K, V>` is invariant over the parameter `K`
11 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
13 error: lifetime may not live long enough
14 --> $DIR/variance-btree-invariant-types.rs:8:5
16 LL | fn iter_cov_val<'a, 'new>(v: IterMut<'a, (), &'static ()>) -> IterMut<'a, (), &'new ()> {
17 | ---- lifetime `'new` defined here
19 | ^ returning this value requires that `'new` must outlive `'static`
21 = note: requirement occurs because of the type `std::collections::btree_map::IterMut<'_, (), &()>`, which makes the generic argument `()` invariant
22 = note: the struct `std::collections::btree_map::IterMut<'a, K, V>` is invariant over the parameter `K`
23 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
25 error: lifetime may not live long enough
26 --> $DIR/variance-btree-invariant-types.rs:12:5
28 LL | fn iter_contra_key<'a, 'new>(v: IterMut<'a, &'new (), ()>) -> IterMut<'a, &'static (), ()> {
29 | ---- lifetime `'new` defined here
31 | ^ returning this value requires that `'new` must outlive `'static`
33 = note: requirement occurs because of the type `std::collections::btree_map::IterMut<'_, &(), ()>`, which makes the generic argument `&()` invariant
34 = note: the struct `std::collections::btree_map::IterMut<'a, K, V>` is invariant over the parameter `K`
35 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
37 error: lifetime may not live long enough
38 --> $DIR/variance-btree-invariant-types.rs:16:5
40 LL | fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (), &'static ()> {
41 | ---- lifetime `'new` defined here
43 | ^ returning this value requires that `'new` must outlive `'static`
45 = note: requirement occurs because of the type `std::collections::btree_map::IterMut<'_, (), &()>`, which makes the generic argument `()` invariant
46 = note: the struct `std::collections::btree_map::IterMut<'a, K, V>` is invariant over the parameter `K`
47 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
49 error: lifetime may not live long enough
50 --> $DIR/variance-btree-invariant-types.rs:21:5
52 LL | fn range_cov_key<'a, 'new>(v: RangeMut<'a, &'static (), ()>) -> RangeMut<'a, &'new (), ()> {
53 | ---- lifetime `'new` defined here
55 | ^ returning this value requires that `'new` must outlive `'static`
57 = note: requirement occurs because of the type `RangeMut<'_, &(), ()>`, which makes the generic argument `&()` invariant
58 = note: the struct `RangeMut<'a, K, V>` is invariant over the parameter `K`
59 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
61 error: lifetime may not live long enough
62 --> $DIR/variance-btree-invariant-types.rs:25:5
64 LL | fn range_cov_val<'a, 'new>(v: RangeMut<'a, (), &'static ()>) -> RangeMut<'a, (), &'new ()> {
65 | ---- lifetime `'new` defined here
67 | ^ returning this value requires that `'new` must outlive `'static`
69 = note: requirement occurs because of the type `RangeMut<'_, (), &()>`, which makes the generic argument `()` invariant
70 = note: the struct `RangeMut<'a, K, V>` is invariant over the parameter `K`
71 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
73 error: lifetime may not live long enough
74 --> $DIR/variance-btree-invariant-types.rs:29:5
76 LL | fn range_contra_key<'a, 'new>(v: RangeMut<'a, &'new (), ()>) -> RangeMut<'a, &'static (), ()> {
77 | ---- lifetime `'new` defined here
79 | ^ returning this value requires that `'new` must outlive `'static`
81 = note: requirement occurs because of the type `RangeMut<'_, &(), ()>`, which makes the generic argument `&()` invariant
82 = note: the struct `RangeMut<'a, K, V>` is invariant over the parameter `K`
83 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
85 error: lifetime may not live long enough
86 --> $DIR/variance-btree-invariant-types.rs:33:5
88 LL | fn range_contra_val<'a, 'new>(v: RangeMut<'a, (), &'new ()>) -> RangeMut<'a, (), &'static ()> {
89 | ---- lifetime `'new` defined here
91 | ^ returning this value requires that `'new` must outlive `'static`
93 = note: requirement occurs because of the type `RangeMut<'_, (), &()>`, which makes the generic argument `()` invariant
94 = note: the struct `RangeMut<'a, K, V>` is invariant over the parameter `K`
95 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
97 error: lifetime may not live long enough
98 --> $DIR/variance-btree-invariant-types.rs:39:5
100 LL | fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>)
101 | ---- lifetime `'new` defined here
102 LL | -> OccupiedEntry<'a, &'new (), ()> {
104 | ^ returning this value requires that `'new` must outlive `'static`
106 = note: requirement occurs because of the type `std::collections::btree_map::OccupiedEntry<'_, &(), ()>`, which makes the generic argument `&()` invariant
107 = note: the struct `std::collections::btree_map::OccupiedEntry<'a, K, V, A>` is invariant over the parameter `K`
108 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
110 error: lifetime may not live long enough
111 --> $DIR/variance-btree-invariant-types.rs:44:5
113 LL | fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>)
114 | ---- lifetime `'new` defined here
115 LL | -> OccupiedEntry<'a, (), &'new ()> {
117 | ^ returning this value requires that `'new` must outlive `'static`
119 = note: requirement occurs because of the type `std::collections::btree_map::OccupiedEntry<'_, (), &()>`, which makes the generic argument `()` invariant
120 = note: the struct `std::collections::btree_map::OccupiedEntry<'a, K, V, A>` is invariant over the parameter `K`
121 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
123 error: lifetime may not live long enough
124 --> $DIR/variance-btree-invariant-types.rs:49:5
126 LL | fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>)
127 | ---- lifetime `'new` defined here
128 LL | -> OccupiedEntry<'a, &'static (), ()> {
130 | ^ returning this value requires that `'new` must outlive `'static`
132 = note: requirement occurs because of the type `std::collections::btree_map::OccupiedEntry<'_, &(), ()>`, which makes the generic argument `&()` invariant
133 = note: the struct `std::collections::btree_map::OccupiedEntry<'a, K, V, A>` is invariant over the parameter `K`
134 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
136 error: lifetime may not live long enough
137 --> $DIR/variance-btree-invariant-types.rs:54:5
139 LL | fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>)
140 | ---- lifetime `'new` defined here
141 LL | -> OccupiedEntry<'a, (), &'static ()> {
143 | ^ returning this value requires that `'new` must outlive `'static`
145 = note: requirement occurs because of the type `std::collections::btree_map::OccupiedEntry<'_, (), &()>`, which makes the generic argument `()` invariant
146 = note: the struct `std::collections::btree_map::OccupiedEntry<'a, K, V, A>` is invariant over the parameter `K`
147 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
149 error: lifetime may not live long enough
150 --> $DIR/variance-btree-invariant-types.rs:60:5
152 LL | fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>)
153 | ---- lifetime `'new` defined here
154 LL | -> VacantEntry<'a, &'new (), ()> {
156 | ^ returning this value requires that `'new` must outlive `'static`
158 = note: requirement occurs because of the type `std::collections::btree_map::VacantEntry<'_, &(), ()>`, which makes the generic argument `&()` invariant
159 = note: the struct `std::collections::btree_map::VacantEntry<'a, K, V, A>` is invariant over the parameter `K`
160 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
162 error: lifetime may not live long enough
163 --> $DIR/variance-btree-invariant-types.rs:65:5
165 LL | fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>)
166 | ---- lifetime `'new` defined here
167 LL | -> VacantEntry<'a, (), &'new ()> {
169 | ^ returning this value requires that `'new` must outlive `'static`
171 = note: requirement occurs because of the type `std::collections::btree_map::VacantEntry<'_, (), &()>`, which makes the generic argument `()` invariant
172 = note: the struct `std::collections::btree_map::VacantEntry<'a, K, V, A>` is invariant over the parameter `K`
173 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
175 error: lifetime may not live long enough
176 --> $DIR/variance-btree-invariant-types.rs:70:5
178 LL | fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>)
179 | ---- lifetime `'new` defined here
180 LL | -> VacantEntry<'a, &'static (), ()> {
182 | ^ returning this value requires that `'new` must outlive `'static`
184 = note: requirement occurs because of the type `std::collections::btree_map::VacantEntry<'_, &(), ()>`, which makes the generic argument `&()` invariant
185 = note: the struct `std::collections::btree_map::VacantEntry<'a, K, V, A>` is invariant over the parameter `K`
186 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
188 error: lifetime may not live long enough
189 --> $DIR/variance-btree-invariant-types.rs:75:5
191 LL | fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>)
192 | ---- lifetime `'new` defined here
193 LL | -> VacantEntry<'a, (), &'static ()> {
195 | ^ returning this value requires that `'new` must outlive `'static`
197 = note: requirement occurs because of the type `std::collections::btree_map::VacantEntry<'_, (), &()>`, which makes the generic argument `()` invariant
198 = note: the struct `std::collections::btree_map::VacantEntry<'a, K, V, A>` is invariant over the parameter `K`
199 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
201 error: aborting due to 16 previous errors