]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized/unsized-struct.stderr
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / unsized / unsized-struct.stderr
1 error[E0277]: the size for values of type `T` cannot be known at compilation time
2   --> $DIR/unsized-struct.rs:6:36
3    |
4 LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
5    |                                    ^^^^^^ doesn't have a size known at compile-time
6    |
7    = help: the trait `std::marker::Sized` is not implemented for `T`
8    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
9    = help: consider adding a `where T: std::marker::Sized` bound
10 note: required by `Foo`
11   --> $DIR/unsized-struct.rs:4:1
12    |
13 LL | struct Foo<T> { data: T }
14    | ^^^^^^^^^^^^^
15
16 error[E0277]: the size for values of type `T` cannot be known at compilation time
17   --> $DIR/unsized-struct.rs:13:24
18    |
19 LL | fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
20    |                        ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
21    |
22    = help: within `Bar<T>`, the trait `std::marker::Sized` is not implemented for `T`
23    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
24    = help: consider adding a `where T: std::marker::Sized` bound
25    = note: required because it appears within the type `Bar<T>`
26 note: required by `is_sized`
27   --> $DIR/unsized-struct.rs:1:1
28    |
29 LL | fn is_sized<T:Sized>() { }
30    | ^^^^^^^^^^^^^^^^^^^^^^
31
32 error: aborting due to 2 previous errors
33
34 For more information about this error, try `rustc --explain E0277`.