|
| 1 | +error: lifetime may not live long enough |
| 2 | + --> $DIR/ptr-to-ptr-principalless.rs:8:5 |
| 3 | + | |
| 4 | +LL | fn unprincipled<'a, 'b>(x: *mut (dyn Send + 'a)) -> *mut (dyn Send + 'b) { |
| 5 | + | -- -- lifetime `'b` defined here |
| 6 | + | | |
| 7 | + | lifetime `'a` defined here |
| 8 | +LL | x as _ |
| 9 | + | ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` |
| 10 | + | |
| 11 | + = help: consider adding the following bound: `'a: 'b` |
| 12 | + = note: requirement occurs because of a mutable pointer to `dyn Send` |
| 13 | + = note: mutable pointers are invariant over their type parameter |
| 14 | + = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance |
| 15 | +note: raw pointer casts of trait objects do not cast away lifetimes |
| 16 | + --> $DIR/ptr-to-ptr-principalless.rs:8:5 |
| 17 | + | |
| 18 | +LL | x as _ |
| 19 | + | ^^^^^^ |
| 20 | + = note: this was previously accepted by the compiler but was changed recently |
| 21 | + = help: see <https://github.com/rust-lang/rust/issues/141402> for more information |
| 22 | + |
| 23 | +error: lifetime may not live long enough |
| 24 | + --> $DIR/ptr-to-ptr-principalless.rs:13:5 |
| 25 | + | |
| 26 | +LL | fn unprincipled_static<'a>(x: *mut (dyn Send + 'a)) -> *mut (dyn Send + 'static) { |
| 27 | + | -- lifetime `'a` defined here |
| 28 | +LL | x as _ |
| 29 | + | ^^^^^^ returning this value requires that `'a` must outlive `'static` |
| 30 | + | |
| 31 | + = note: requirement occurs because of a mutable pointer to `dyn Send` |
| 32 | + = note: mutable pointers are invariant over their type parameter |
| 33 | + = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance |
| 34 | +note: raw pointer casts of trait objects do not cast away lifetimes |
| 35 | + --> $DIR/ptr-to-ptr-principalless.rs:13:5 |
| 36 | + | |
| 37 | +LL | x as _ |
| 38 | + | ^^^^^^ |
| 39 | + = note: this was previously accepted by the compiler but was changed recently |
| 40 | + = help: see <https://github.com/rust-lang/rust/issues/141402> for more information |
| 41 | +help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x` |
| 42 | + | |
| 43 | +LL - fn unprincipled_static<'a>(x: *mut (dyn Send + 'a)) -> *mut (dyn Send + 'static) { |
| 44 | +LL + fn unprincipled_static<'a>(x: *mut (dyn Send + 'a)) -> *mut (dyn Send + 'a) { |
| 45 | + | |
| 46 | +help: alternatively, add an explicit `'static` bound to this reference |
| 47 | + | |
| 48 | +LL - fn unprincipled_static<'a>(x: *mut (dyn Send + 'a)) -> *mut (dyn Send + 'static) { |
| 49 | +LL + fn unprincipled_static<'a>(x: *mut (dyn Send + 'static)) -> *mut (dyn Send + 'static) { |
| 50 | + | |
| 51 | + |
| 52 | +error: lifetime may not live long enough |
| 53 | + --> $DIR/ptr-to-ptr-principalless.rs:18:5 |
| 54 | + | |
| 55 | +LL | fn unprincipled_wrap<'a, 'b>(x: *mut (dyn Send + 'a)) -> *mut Wrapper<dyn Send + 'b> { |
| 56 | + | -- -- lifetime `'b` defined here |
| 57 | + | | |
| 58 | + | lifetime `'a` defined here |
| 59 | +LL | x as _ |
| 60 | + | ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` |
| 61 | + | |
| 62 | + = help: consider adding the following bound: `'a: 'b` |
| 63 | + = note: requirement occurs because of a mutable pointer to `Wrapper<dyn Send>` |
| 64 | + = note: mutable pointers are invariant over their type parameter |
| 65 | + = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance |
| 66 | +note: raw pointer casts of trait objects do not cast away lifetimes |
| 67 | + --> $DIR/ptr-to-ptr-principalless.rs:18:5 |
| 68 | + | |
| 69 | +LL | x as _ |
| 70 | + | ^^^^^^ |
| 71 | + = note: this was previously accepted by the compiler but was changed recently |
| 72 | + = help: see <https://github.com/rust-lang/rust/issues/141402> for more information |
| 73 | + |
| 74 | +error: lifetime may not live long enough |
| 75 | + --> $DIR/ptr-to-ptr-principalless.rs:23:5 |
| 76 | + | |
| 77 | +LL | fn unprincipled_wrap_static<'a>(x: *mut (dyn Send + 'a)) -> *mut Wrapper<dyn Send + 'static> { |
| 78 | + | -- lifetime `'a` defined here |
| 79 | +LL | x as _ |
| 80 | + | ^^^^^^ returning this value requires that `'a` must outlive `'static` |
| 81 | + | |
| 82 | + = note: requirement occurs because of a mutable pointer to `Wrapper<dyn Send>` |
| 83 | + = note: mutable pointers are invariant over their type parameter |
| 84 | + = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance |
| 85 | +note: raw pointer casts of trait objects do not cast away lifetimes |
| 86 | + --> $DIR/ptr-to-ptr-principalless.rs:23:5 |
| 87 | + | |
| 88 | +LL | x as _ |
| 89 | + | ^^^^^^ |
| 90 | + = note: this was previously accepted by the compiler but was changed recently |
| 91 | + = help: see <https://github.com/rust-lang/rust/issues/141402> for more information |
| 92 | +help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x` |
| 93 | + | |
| 94 | +LL - fn unprincipled_wrap_static<'a>(x: *mut (dyn Send + 'a)) -> *mut Wrapper<dyn Send + 'static> { |
| 95 | +LL + fn unprincipled_wrap_static<'a>(x: *mut (dyn Send + 'a)) -> *mut Wrapper<dyn Send + 'a> { |
| 96 | + | |
| 97 | +help: alternatively, add an explicit `'static` bound to this reference |
| 98 | + | |
| 99 | +LL - fn unprincipled_wrap_static<'a>(x: *mut (dyn Send + 'a)) -> *mut Wrapper<dyn Send + 'static> { |
| 100 | +LL + fn unprincipled_wrap_static<'a>(x: *mut (dyn Send + 'static)) -> *mut Wrapper<dyn Send + 'static> { |
| 101 | + | |
| 102 | + |
| 103 | +error: lifetime may not live long enough |
| 104 | + --> $DIR/ptr-to-ptr-principalless.rs:30:5 |
| 105 | + | |
| 106 | +LL | fn unprincipled2<'a, 'b>(x: *mut (dyn Send + 'a)) -> *mut (dyn Sync + 'b) { |
| 107 | + | -- -- lifetime `'b` defined here |
| 108 | + | | |
| 109 | + | lifetime `'a` defined here |
| 110 | +LL | x as _ |
| 111 | + | ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` |
| 112 | + | |
| 113 | + = help: consider adding the following bound: `'a: 'b` |
| 114 | + = note: requirement occurs because of a mutable pointer to `dyn Sync` |
| 115 | + = note: mutable pointers are invariant over their type parameter |
| 116 | + = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance |
| 117 | +note: raw pointer casts of trait objects do not cast away lifetimes |
| 118 | + --> $DIR/ptr-to-ptr-principalless.rs:30:5 |
| 119 | + | |
| 120 | +LL | x as _ |
| 121 | + | ^^^^^^ |
| 122 | + = note: this was previously accepted by the compiler but was changed recently |
| 123 | + = help: see <https://github.com/rust-lang/rust/issues/141402> for more information |
| 124 | + |
| 125 | +error: lifetime may not live long enough |
| 126 | + --> $DIR/ptr-to-ptr-principalless.rs:35:5 |
| 127 | + | |
| 128 | +LL | fn unprincipled2_static<'a>(x: *mut (dyn Send + 'a)) -> *mut (dyn Sync + 'static) { |
| 129 | + | -- lifetime `'a` defined here |
| 130 | +LL | x as _ |
| 131 | + | ^^^^^^ returning this value requires that `'a` must outlive `'static` |
| 132 | + | |
| 133 | + = note: requirement occurs because of a mutable pointer to `dyn Sync` |
| 134 | + = note: mutable pointers are invariant over their type parameter |
| 135 | + = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance |
| 136 | +note: raw pointer casts of trait objects do not cast away lifetimes |
| 137 | + --> $DIR/ptr-to-ptr-principalless.rs:35:5 |
| 138 | + | |
| 139 | +LL | x as _ |
| 140 | + | ^^^^^^ |
| 141 | + = note: this was previously accepted by the compiler but was changed recently |
| 142 | + = help: see <https://github.com/rust-lang/rust/issues/141402> for more information |
| 143 | +help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x` |
| 144 | + | |
| 145 | +LL - fn unprincipled2_static<'a>(x: *mut (dyn Send + 'a)) -> *mut (dyn Sync + 'static) { |
| 146 | +LL + fn unprincipled2_static<'a>(x: *mut (dyn Send + 'a)) -> *mut (dyn Sync + 'a) { |
| 147 | + | |
| 148 | +help: alternatively, add an explicit `'static` bound to this reference |
| 149 | + | |
| 150 | +LL - fn unprincipled2_static<'a>(x: *mut (dyn Send + 'a)) -> *mut (dyn Sync + 'static) { |
| 151 | +LL + fn unprincipled2_static<'a>(x: *mut (dyn Send + 'static)) -> *mut (dyn Sync + 'static) { |
| 152 | + | |
| 153 | + |
| 154 | +error: lifetime may not live long enough |
| 155 | + --> $DIR/ptr-to-ptr-principalless.rs:40:5 |
| 156 | + | |
| 157 | +LL | fn unprincipled_wrap2<'a, 'b>(x: *mut (dyn Send + 'a)) -> *mut Wrapper<dyn Sync + 'b> { |
| 158 | + | -- -- lifetime `'b` defined here |
| 159 | + | | |
| 160 | + | lifetime `'a` defined here |
| 161 | +LL | x as _ |
| 162 | + | ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` |
| 163 | + | |
| 164 | + = help: consider adding the following bound: `'a: 'b` |
| 165 | + = note: requirement occurs because of a mutable pointer to `Wrapper<dyn Sync>` |
| 166 | + = note: mutable pointers are invariant over their type parameter |
| 167 | + = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance |
| 168 | +note: raw pointer casts of trait objects do not cast away lifetimes |
| 169 | + --> $DIR/ptr-to-ptr-principalless.rs:40:5 |
| 170 | + | |
| 171 | +LL | x as _ |
| 172 | + | ^^^^^^ |
| 173 | + = note: this was previously accepted by the compiler but was changed recently |
| 174 | + = help: see <https://github.com/rust-lang/rust/issues/141402> for more information |
| 175 | + |
| 176 | +error: lifetime may not live long enough |
| 177 | + --> $DIR/ptr-to-ptr-principalless.rs:45:5 |
| 178 | + | |
| 179 | +LL | fn unprincipled_wrap2_static<'a>(x: *mut (dyn Send + 'a)) -> *mut Wrapper<dyn Sync + 'static> { |
| 180 | + | -- lifetime `'a` defined here |
| 181 | +LL | x as _ |
| 182 | + | ^^^^^^ returning this value requires that `'a` must outlive `'static` |
| 183 | + | |
| 184 | + = note: requirement occurs because of a mutable pointer to `Wrapper<dyn Sync>` |
| 185 | + = note: mutable pointers are invariant over their type parameter |
| 186 | + = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance |
| 187 | +note: raw pointer casts of trait objects do not cast away lifetimes |
| 188 | + --> $DIR/ptr-to-ptr-principalless.rs:45:5 |
| 189 | + | |
| 190 | +LL | x as _ |
| 191 | + | ^^^^^^ |
| 192 | + = note: this was previously accepted by the compiler but was changed recently |
| 193 | + = help: see <https://github.com/rust-lang/rust/issues/141402> for more information |
| 194 | +help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x` |
| 195 | + | |
| 196 | +LL - fn unprincipled_wrap2_static<'a>(x: *mut (dyn Send + 'a)) -> *mut Wrapper<dyn Sync + 'static> { |
| 197 | +LL + fn unprincipled_wrap2_static<'a>(x: *mut (dyn Send + 'a)) -> *mut Wrapper<dyn Sync + 'a> { |
| 198 | + | |
| 199 | +help: alternatively, add an explicit `'static` bound to this reference |
| 200 | + | |
| 201 | +LL - fn unprincipled_wrap2_static<'a>(x: *mut (dyn Send + 'a)) -> *mut Wrapper<dyn Sync + 'static> { |
| 202 | +LL + fn unprincipled_wrap2_static<'a>(x: *mut (dyn Send + 'static)) -> *mut Wrapper<dyn Sync + 'static> { |
| 203 | + | |
| 204 | + |
| 205 | +error: aborting due to 8 previous errors |
| 206 | + |
0 commit comments