summary refs log tree commit diff
path: root/tests/ui/consts/const-unsized.stderr
blob: a37a6df71f83c65c443c30c560cef0aabae2e9bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time
  --> $DIR/const-unsized.rs:3:16
   |
LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync));
   |                ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
   = note: statics and constants must have a statically known size

error[E0277]: the size for values of type `str` cannot be known at compilation time
  --> $DIR/const-unsized.rs:7:18
   |
LL | const CONST_FOO: str = *"foo";
   |                  ^^^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `str`
   = note: statics and constants must have a statically known size

error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time
  --> $DIR/const-unsized.rs:11:1
   |
LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync));
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
   = note: statics and constants must have a statically known size

error[E0277]: the size for values of type `str` cannot be known at compilation time
  --> $DIR/const-unsized.rs:14:1
   |
LL | static STATIC_BAR: str = *"bar";
   | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `str`
   = note: statics and constants must have a statically known size

error[E0507]: cannot move out of a shared reference
  --> $DIR/const-unsized.rs:3:35
   |
LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync));
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because value has type `dyn Debug + Sync`, which does not implement the `Copy` trait

error[E0507]: cannot move out of a shared reference
  --> $DIR/const-unsized.rs:7:24
   |
LL | const CONST_FOO: str = *"foo";
   |                        ^^^^^^ move occurs because value has type `str`, which does not implement the `Copy` trait

error: aborting due to 6 previous errors

Some errors have detailed explanations: E0277, E0507.
For more information about an error, try `rustc --explain E0277`.