File: issue-unsized-tail-restatic-ice-122488.stderr

package info (click to toggle)
rustc 1.87.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 925,564 kB
  • sloc: xml: 158,127; python: 36,039; javascript: 19,761; sh: 19,737; cpp: 18,981; ansic: 13,133; asm: 4,376; makefile: 710; perl: 29; lisp: 28; ruby: 19; sql: 11
file content (34 lines) | stat: -rw-r--r-- 1,695 bytes parent folder | download | duplicates (7)
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
error[E0277]: the size for values of type `V` cannot be known at compilation time
  --> $DIR/issue-unsized-tail-restatic-ice-122488.rs:5:61
   |
LL | struct ArenaSet<U: Deref, V: ?Sized = <U as Deref>::Target>(V, U);
   |                           --------------------------------  ^ doesn't have a size known at compile-time
   |                           |
   |                           this type parameter needs to be `Sized`
   |
   = note: only the last field of a struct may have a dynamically sized type
   = help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
   |
LL - struct ArenaSet<U: Deref, V: ?Sized = <U as Deref>::Target>(V, U);
LL + struct ArenaSet<U: Deref, V = <U as Deref>::Target>(V, U);
   |
help: borrowed types always have a statically known size
   |
LL | struct ArenaSet<U: Deref, V: ?Sized = <U as Deref>::Target>(&V, U);
   |                                                             +
help: the `Box` type always has a statically known size and allocates its contents in the heap
   |
LL | struct ArenaSet<U: Deref, V: ?Sized = <U as Deref>::Target>(Box<V>, U);
   |                                                             ++++ +

error[E0080]: evaluation of constant value failed
  --> $DIR/issue-unsized-tail-restatic-ice-122488.rs:8:1
   |
LL | const DATA: *const ArenaSet<Vec<u8>> = std::ptr::null_mut();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the type `ArenaSet<Vec<u8>, [u8]>` has an unknown layout

error: aborting due to 2 previous errors

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