]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-unsized.stderr
Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthewjasper
[rust.git] / src / test / ui / consts / const-unsized.stderr
1 error[E0277]: the size for values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time
2   --> $DIR/const-unsized.rs:3:16
3    |
4 LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync));
5    |                ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
6    |
7    = help: the trait `std::marker::Sized` is not implemented for `(dyn std::fmt::Debug + std::marker::Sync + 'static)`
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
10 error[E0277]: the size for values of type `str` cannot be known at compilation time
11   --> $DIR/const-unsized.rs:6:18
12    |
13 LL | const CONST_FOO: str = *"foo";
14    |                  ^^^ doesn't have a size known at compile-time
15    |
16    = help: the trait `std::marker::Sized` is not implemented for `str`
17    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
18
19 error[E0277]: the size for values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time
20   --> $DIR/const-unsized.rs:9:18
21    |
22 LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync));
23    |                  ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
24    |
25    = help: the trait `std::marker::Sized` is not implemented for `(dyn std::fmt::Debug + std::marker::Sync + 'static)`
26    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
27
28 error[E0277]: the size for values of type `str` cannot be known at compilation time
29   --> $DIR/const-unsized.rs:12:20
30    |
31 LL | static STATIC_BAR: str = *"bar";
32    |                    ^^^ doesn't have a size known at compile-time
33    |
34    = help: the trait `std::marker::Sized` is not implemented for `str`
35    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
36
37 error: aborting due to 4 previous errors
38
39 For more information about this error, try `rustc --explain E0277`.