fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0277]: the size for values of type `Y` cannot be known at compilation time 2 --> $DIR/unsized6.rs:9:9 3 | 4LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) { 5 | - this type parameter needs to be `Sized` 6... 7LL | let y: Y; 8 | ^ doesn't have a size known at compile-time 9 | 10 = note: all local variables must have a statically known size 11 = help: unsized locals are gated as an unstable feature 12help: consider removing the `?Sized` bound to make the type parameter `Sized` 13 | 14LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) { 15LL + fn f1<W: ?Sized, X: ?Sized, Y, Z: ?Sized>(x: &X) { 16 | 17help: consider borrowing here 18 | 19LL | let y: &Y; 20 | + 21 22error[E0277]: the size for values of type `X` cannot be known at compilation time 23 --> $DIR/unsized6.rs:7:12 24 | 25LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) { 26 | - this type parameter needs to be `Sized` 27LL | let _: W; // <-- this is OK, no bindings created, no initializer. 28LL | let _: (isize, (X, isize)); 29 | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time 30 | 31 = note: only the last element of a tuple may have a dynamically sized type 32help: consider removing the `?Sized` bound to make the type parameter `Sized` 33 | 34LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) { 35LL + fn f1<W: ?Sized, X, Y: ?Sized, Z: ?Sized>(x: &X) { 36 | 37 38error[E0277]: the size for values of type `Z` cannot be known at compilation time 39 --> $DIR/unsized6.rs:11:12 40 | 41LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) { 42 | - this type parameter needs to be `Sized` 43... 44LL | let y: (isize, (Z, usize)); 45 | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time 46 | 47 = note: only the last element of a tuple may have a dynamically sized type 48help: consider removing the `?Sized` bound to make the type parameter `Sized` 49 | 50LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) { 51LL + fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z>(x: &X) { 52 | 53 54error[E0277]: the size for values of type `X` cannot be known at compilation time 55 --> $DIR/unsized6.rs:15:9 56 | 57LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) { 58 | - this type parameter needs to be `Sized` 59LL | let y: X; 60 | ^ doesn't have a size known at compile-time 61 | 62 = note: all local variables must have a statically known size 63 = help: unsized locals are gated as an unstable feature 64help: consider removing the `?Sized` bound to make the type parameter `Sized` 65 | 66LL - fn f2<X: ?Sized, Y: ?Sized>(x: &X) { 67LL + fn f2<X, Y: ?Sized>(x: &X) { 68 | 69help: consider borrowing here 70 | 71LL | let y: &X; 72 | + 73 74error[E0277]: the size for values of type `Y` cannot be known at compilation time 75 --> $DIR/unsized6.rs:17:12 76 | 77LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) { 78 | - this type parameter needs to be `Sized` 79... 80LL | let y: (isize, (Y, isize)); 81 | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time 82 | 83 = note: only the last element of a tuple may have a dynamically sized type 84help: consider removing the `?Sized` bound to make the type parameter `Sized` 85 | 86LL - fn f2<X: ?Sized, Y: ?Sized>(x: &X) { 87LL + fn f2<X: ?Sized, Y>(x: &X) { 88 | 89 90error[E0277]: the size for values of type `X` cannot be known at compilation time 91 --> $DIR/unsized6.rs:22:9 92 | 93LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 94 | - this type parameter needs to be `Sized` 95LL | let y: X = *x1; 96 | ^ doesn't have a size known at compile-time 97 | 98 = note: all local variables must have a statically known size 99 = help: unsized locals are gated as an unstable feature 100help: consider removing the `?Sized` bound to make the type parameter `Sized` 101 | 102LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 103LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 104 | 105help: consider borrowing here 106 | 107LL | let y: &X = *x1; 108 | + 109 110error[E0277]: the size for values of type `X` cannot be known at compilation time 111 --> $DIR/unsized6.rs:24:9 112 | 113LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 114 | - this type parameter needs to be `Sized` 115... 116LL | let y = *x2; 117 | ^ doesn't have a size known at compile-time 118 | 119 = note: all local variables must have a statically known size 120 = help: unsized locals are gated as an unstable feature 121help: consider removing the `?Sized` bound to make the type parameter `Sized` 122 | 123LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 124LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 125 | 126 127error[E0277]: the size for values of type `X` cannot be known at compilation time 128 --> $DIR/unsized6.rs:26:10 129 | 130LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 131 | - this type parameter needs to be `Sized` 132... 133LL | let (y, z) = (*x3, 4); 134 | ^ doesn't have a size known at compile-time 135 | 136 = note: all local variables must have a statically known size 137 = help: unsized locals are gated as an unstable feature 138help: consider removing the `?Sized` bound to make the type parameter `Sized` 139 | 140LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 141LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 142 | 143 144error[E0277]: the size for values of type `X` cannot be known at compilation time 145 --> $DIR/unsized6.rs:30:9 146 | 147LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 148 | - this type parameter needs to be `Sized` 149LL | let y: X = *x1; 150 | ^ doesn't have a size known at compile-time 151 | 152 = note: all local variables must have a statically known size 153 = help: unsized locals are gated as an unstable feature 154help: consider removing the `?Sized` bound to make the type parameter `Sized` 155 | 156LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 157LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 158 | 159help: consider borrowing here 160 | 161LL | let y: &X = *x1; 162 | + 163 164error[E0277]: the size for values of type `X` cannot be known at compilation time 165 --> $DIR/unsized6.rs:32:9 166 | 167LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 168 | - this type parameter needs to be `Sized` 169... 170LL | let y = *x2; 171 | ^ doesn't have a size known at compile-time 172 | 173 = note: all local variables must have a statically known size 174 = help: unsized locals are gated as an unstable feature 175help: consider removing the `?Sized` bound to make the type parameter `Sized` 176 | 177LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 178LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 179 | 180 181error[E0277]: the size for values of type `X` cannot be known at compilation time 182 --> $DIR/unsized6.rs:34:10 183 | 184LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 185 | - this type parameter needs to be `Sized` 186... 187LL | let (y, z) = (*x3, 4); 188 | ^ doesn't have a size known at compile-time 189 | 190 = note: all local variables must have a statically known size 191 = help: unsized locals are gated as an unstable feature 192help: consider removing the `?Sized` bound to make the type parameter `Sized` 193 | 194LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 195LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { 196 | 197 198error[E0277]: the size for values of type `X` cannot be known at compilation time 199 --> $DIR/unsized6.rs:38:18 200 | 201LL | fn g1<X: ?Sized>(x: X) {} 202 | - ^ doesn't have a size known at compile-time 203 | | 204 | this type parameter needs to be `Sized` 205 | 206 = help: unsized fn params are gated as an unstable feature 207help: consider removing the `?Sized` bound to make the type parameter `Sized` 208 | 209LL - fn g1<X: ?Sized>(x: X) {} 210LL + fn g1<X>(x: X) {} 211 | 212help: function arguments must have a statically known size, borrowed types always have a known size 213 | 214LL | fn g1<X: ?Sized>(x: &X) {} 215 | + 216 217error[E0277]: the size for values of type `X` cannot be known at compilation time 218 --> $DIR/unsized6.rs:40:22 219 | 220LL | fn g2<X: ?Sized + T>(x: X) {} 221 | - ^ doesn't have a size known at compile-time 222 | | 223 | this type parameter needs to be `Sized` 224 | 225 = help: unsized fn params are gated as an unstable feature 226help: consider removing the `?Sized` bound to make the type parameter `Sized` 227 | 228LL - fn g2<X: ?Sized + T>(x: X) {} 229LL + fn g2<X: T>(x: X) {} 230 | 231help: function arguments must have a statically known size, borrowed types always have a known size 232 | 233LL | fn g2<X: ?Sized + T>(x: &X) {} 234 | + 235 236error: aborting due to 13 previous errors 237 238For more information about this error, try `rustc --explain E0277`.