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