@@ -6,15 +6,6 @@ LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync));
66 |
77 = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
88
9- error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time
10- --> $DIR/const-unsized.rs:3:35
11- |
12- LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync));
13- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
14- |
15- = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
16- = note: constant expressions must have a statically known size
17-
189error[E0277]: the size for values of type `str` cannot be known at compilation time
1910 --> $DIR/const-unsized.rs:7:18
2011 |
@@ -23,15 +14,6 @@ LL | const CONST_FOO: str = *"foo";
2314 |
2415 = help: the trait `Sized` is not implemented for `str`
2516
26- error[E0277]: the size for values of type `str` cannot be known at compilation time
27- --> $DIR/const-unsized.rs:7:24
28- |
29- LL | const CONST_FOO: str = *"foo";
30- | ^^^^^^ doesn't have a size known at compile-time
31- |
32- = help: the trait `Sized` is not implemented for `str`
33- = note: constant expressions must have a statically known size
34-
3517error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time
3618 --> $DIR/const-unsized.rs:11:18
3719 |
@@ -40,15 +22,6 @@ LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync));
4022 |
4123 = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
4224
43- error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time
44- --> $DIR/const-unsized.rs:11:37
45- |
46- LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync));
47- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
48- |
49- = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
50- = note: constant expressions must have a statically known size
51-
5225error[E0277]: the size for values of type `str` cannot be known at compilation time
5326 --> $DIR/const-unsized.rs:15:20
5427 |
@@ -57,14 +30,29 @@ LL | static STATIC_BAR: str = *"bar";
5730 |
5831 = help: the trait `Sized` is not implemented for `str`
5932
60- error[E0277]: the size for values of type `str` cannot be known at compilation time
33+ error[E0507]: cannot move out of a shared reference
34+ --> $DIR/const-unsized.rs:3:35
35+ |
36+ LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync));
37+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because value has type `dyn Debug + Sync`, which does not implement the `Copy` trait
38+
39+ error[E0507]: cannot move out of a shared reference
40+ --> $DIR/const-unsized.rs:7:24
41+ |
42+ LL | const CONST_FOO: str = *"foo";
43+ | ^^^^^^ move occurs because value has type `str`, which does not implement the `Copy` trait
44+
45+ error[E0507]: cannot move out of a shared reference
46+ --> $DIR/const-unsized.rs:11:37
47+ |
48+ LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync));
49+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because value has type `dyn Debug + Sync`, which does not implement the `Copy` trait
50+
51+ error[E0507]: cannot move out of a shared reference
6152 --> $DIR/const-unsized.rs:15:26
6253 |
6354LL | static STATIC_BAR: str = *"bar";
64- | ^^^^^^ doesn't have a size known at compile-time
65- |
66- = help: the trait `Sized` is not implemented for `str`
67- = note: constant expressions must have a statically known size
55+ | ^^^^^^ move occurs because value has type `str`, which does not implement the `Copy` trait
6856
6957error[E0161]: cannot move a value of type `str`
7058 --> $DIR/const-unsized.rs:20:48
@@ -80,5 +68,5 @@ LL | println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATI
8068
8169error: aborting due to 10 previous errors
8270
83- Some errors have detailed explanations: E0161, E0277.
71+ Some errors have detailed explanations: E0161, E0277, E0507 .
8472For more information about an error, try `rustc --explain E0161`.
0 commit comments