]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized3.stderr
Auto merge of #66911 - eddyb:nicer-rustc_regions, r=matthewjasper
[rust.git] / src / test / ui / unsized3.stderr
1 error[E0277]: the size for values of type `X` cannot be known at compilation time
2   --> $DIR/unsized3.rs:7:13
3    |
4 LL | fn f1<X: ?Sized>(x: &X) {
5    |       -- help: consider further restricting this bound: `X: std::marker::Sized +`
6 LL |     f2::<X>(x);
7    |             ^ doesn't have a size known at compile-time
8 ...
9 LL | fn f2<X>(x: &X) {
10    |    -- - required by this bound in `f2`
11    |
12    = help: the trait `std::marker::Sized` is not implemented for `X`
13    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
14
15 error[E0277]: the size for values of type `X` cannot be known at compilation time
16   --> $DIR/unsized3.rs:18:13
17    |
18 LL | fn f3<X: ?Sized + T>(x: &X) {
19    |       -- help: consider further restricting this bound: `X: std::marker::Sized +`
20 LL |     f4::<X>(x);
21    |             ^ doesn't have a size known at compile-time
22 ...
23 LL | fn f4<X: T>(x: &X) {
24    |    -- - required by this bound in `f4`
25    |
26    = help: the trait `std::marker::Sized` is not implemented for `X`
27    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
28
29 error[E0277]: the size for values of type `X` cannot be known at compilation time
30   --> $DIR/unsized3.rs:33:8
31    |
32 LL | fn f5<Y>(x: &Y) {}
33    |    -- - required by this bound in `f5`
34 ...
35 LL | fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
36    |       -- help: consider further restricting this bound: `X: std::marker::Sized +`
37 LL |     f5(x1);
38    |        ^^ doesn't have a size known at compile-time
39    |
40    = help: within `S<X>`, the trait `std::marker::Sized` is not implemented for `X`
41    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
42    = note: required because it appears within the type `S<X>`
43
44 error[E0277]: the size for values of type `X` cannot be known at compilation time
45   --> $DIR/unsized3.rs:40:8
46    |
47 LL | fn f9<X: ?Sized>(x1: Box<S<X>>) {
48    |       -- help: consider further restricting this bound: `X: std::marker::Sized +`
49 LL |     f5(&(*x1, 34));
50    |        ^^^^^^^^^^ doesn't have a size known at compile-time
51    |
52    = help: within `S<X>`, the trait `std::marker::Sized` is not implemented for `X`
53    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
54    = note: required because it appears within the type `S<X>`
55    = note: only the last element of a tuple may have a dynamically sized type
56
57 error[E0277]: the size for values of type `X` cannot be known at compilation time
58   --> $DIR/unsized3.rs:45:9
59    |
60 LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
61    |        -- help: consider further restricting this bound: `X: std::marker::Sized +`
62 LL |     f5(&(32, *x1));
63    |         ^^^^^^^^^ doesn't have a size known at compile-time
64    |
65    = help: within `({integer}, S<X>)`, the trait `std::marker::Sized` is not implemented for `X`
66    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
67    = note: required because it appears within the type `S<X>`
68    = note: required because it appears within the type `({integer}, S<X>)`
69    = note: tuples must have a statically known size to be initialized
70
71 error[E0277]: the size for values of type `X` cannot be known at compilation time
72   --> $DIR/unsized3.rs:45:8
73    |
74 LL | fn f5<Y>(x: &Y) {}
75    |    -- - required by this bound in `f5`
76 ...
77 LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
78    |        -- help: consider further restricting this bound: `X: std::marker::Sized +`
79 LL |     f5(&(32, *x1));
80    |        ^^^^^^^^^^ doesn't have a size known at compile-time
81    |
82    = help: within `({integer}, S<X>)`, the trait `std::marker::Sized` is not implemented for `X`
83    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
84    = note: required because it appears within the type `S<X>`
85    = note: required because it appears within the type `({integer}, S<X>)`
86
87 error: aborting due to 6 previous errors
88
89 For more information about this error, try `rustc --explain E0277`.