@@ -6,15 +6,6 @@ LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync));
6
6
|
7
7
= help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
8
8
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
-
18
9
error[E0277]: the size for values of type `str` cannot be known at compilation time
19
10
--> $DIR/const-unsized.rs:7:18
20
11
|
@@ -23,15 +14,6 @@ LL | const CONST_FOO: str = *"foo";
23
14
|
24
15
= help: the trait `Sized` is not implemented for `str`
25
16
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
-
35
17
error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time
36
18
--> $DIR/const-unsized.rs:11:18
37
19
|
@@ -40,15 +22,6 @@ LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync));
40
22
|
41
23
= help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
42
24
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
-
52
25
error[E0277]: the size for values of type `str` cannot be known at compilation time
53
26
--> $DIR/const-unsized.rs:15:20
54
27
|
@@ -57,14 +30,29 @@ LL | static STATIC_BAR: str = *"bar";
57
30
|
58
31
= help: the trait `Sized` is not implemented for `str`
59
32
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
61
52
--> $DIR/const-unsized.rs:15:26
62
53
|
63
54
LL | 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
68
56
69
57
error[E0161]: cannot move a value of type `str`
70
58
--> $DIR/const-unsized.rs:20:48
@@ -80,5 +68,5 @@ LL | println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATI
80
68
81
69
error: aborting due to 10 previous errors
82
70
83
- Some errors have detailed explanations: E0161, E0277.
71
+ Some errors have detailed explanations: E0161, E0277, E0507 .
84
72
For more information about an error, try `rustc --explain E0161`.
0 commit comments