@@ -7,6 +7,16 @@ LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync));
77 = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
88 = note: statics and constants must have a statically known size
99
10+ error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time
11+ --> $DIR/const-unsized.rs:3:16
12+ |
13+ LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync));
14+ | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
15+ |
16+ = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
17+ = note: statics and constants must have a statically known size
18+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
19+
1020error[E0277]: the size for values of type `str` cannot be known at compilation time
1121 --> $DIR/const-unsized.rs:7:18
1222 |
@@ -16,6 +26,25 @@ LL | const CONST_FOO: str = *"foo";
1626 = help: the trait `Sized` is not implemented for `str`
1727 = note: statics and constants must have a statically known size
1828
29+ error[E0277]: the size for values of type `str` cannot be known at compilation time
30+ --> $DIR/const-unsized.rs:7:18
31+ |
32+ LL | const CONST_FOO: str = *"foo";
33+ | ^^^ doesn't have a size known at compile-time
34+ |
35+ = help: the trait `Sized` is not implemented for `str`
36+ = note: statics and constants must have a statically known size
37+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
38+
39+ error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time
40+ --> $DIR/const-unsized.rs:11:18
41+ |
42+ LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync));
43+ | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
44+ |
45+ = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
46+ = note: statics and constants must have a statically known size
47+
1948error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time
2049 --> $DIR/const-unsized.rs:11:18
2150 |
@@ -24,6 +53,7 @@ LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync));
2453 |
2554 = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
2655 = note: statics and constants must have a statically known size
56+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2757
2858error[E0277]: the size for values of type `str` cannot be known at compilation time
2959 --> $DIR/const-unsized.rs:15:20
@@ -34,29 +64,15 @@ LL | static STATIC_BAR: str = *"bar";
3464 = help: the trait `Sized` is not implemented for `str`
3565 = note: statics and constants must have a statically known size
3666
37- error[E0507]: cannot move out of a shared reference
38- --> $DIR/const-unsized.rs:3:35
39- |
40- LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync));
41- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because value has type `dyn Debug + Sync`, which does not implement the `Copy` trait
42-
43- error[E0507]: cannot move out of a shared reference
44- --> $DIR/const-unsized.rs:7:24
45- |
46- LL | const CONST_FOO: str = *"foo";
47- | ^^^^^^ move occurs because value has type `str`, which does not implement the `Copy` trait
48-
49- error[E0507]: cannot move out of a shared reference
50- --> $DIR/const-unsized.rs:11:37
51- |
52- LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync));
53- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because value has type `dyn Debug + Sync`, which does not implement the `Copy` trait
54-
55- error[E0507]: cannot move out of a shared reference
56- --> $DIR/const-unsized.rs:15:26
67+ error[E0277]: the size for values of type `str` cannot be known at compilation time
68+ --> $DIR/const-unsized.rs:15:20
5769 |
5870LL | static STATIC_BAR: str = *"bar";
59- | ^^^^^^ move occurs because value has type `str`, which does not implement the `Copy` trait
71+ | ^^^ doesn't have a size known at compile-time
72+ |
73+ = help: the trait `Sized` is not implemented for `str`
74+ = note: statics and constants must have a statically known size
75+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
6076
6177error[E0161]: cannot move a value of type `str`
6278 --> $DIR/const-unsized.rs:20:48
@@ -72,5 +88,5 @@ LL | println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATI
7288
7389error: aborting due to 10 previous errors
7490
75- Some errors have detailed explanations: E0161, E0277, E0507 .
91+ Some errors have detailed explanations: E0161, E0277.
7692For more information about an error, try `rustc --explain E0161`.
0 commit comments