File: invalid_dispatch_from_dyn_impls.stderr

package info (click to toggle)
rustc 1.88.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 934,128 kB
  • sloc: xml: 158,127; python: 36,062; javascript: 19,855; sh: 19,700; cpp: 18,947; ansic: 12,993; asm: 4,792; makefile: 690; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (60 lines) | stat: -rw-r--r-- 2,424 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, ZST fields with 1 byte alignment that don't mention type/const generics, and nothing else
  --> $DIR/invalid_dispatch_from_dyn_impls.rs:10:1
   |
LL | / impl<T, U> DispatchFromDyn<WrapperWithExtraField<U>> for WrapperWithExtraField<T>
LL | |
LL | | where
LL | |     T: DispatchFromDyn<U>,
   | |__________________________^
   |
   = note: extra field `1` of type `i32` is not allowed

error[E0375]: implementing `DispatchFromDyn` does not allow multiple fields to be coerced
  --> $DIR/invalid_dispatch_from_dyn_impls.rs:22:1
   |
LL | / impl<T: ?Sized, U: ?Sized> DispatchFromDyn<MultiplePointers<U>> for MultiplePointers<T>
LL | |
LL | | where
LL | |     T: Unsize<U>,
   | |_________________^
   |
note: the trait `DispatchFromDyn` may only be implemented when a single field is being coerced
  --> $DIR/invalid_dispatch_from_dyn_impls.rs:18:5
   |
LL |     ptr1: *const T,
   |     ^^^^^^^^^^^^^^
LL |     ptr2: *const T,
   |     ^^^^^^^^^^^^^^

error[E0374]: implementing `DispatchFromDyn` requires a field to be coerced
  --> $DIR/invalid_dispatch_from_dyn_impls.rs:33:1
   |
LL | impl<T: ?Sized, U: ?Sized> DispatchFromDyn<NothingToCoerce<T>> for NothingToCoerce<U> {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: expected a single field to be coerced, none found

error[E0378]: structs implementing `DispatchFromDyn` may not have `#[repr(packed)]` or `#[repr(C)]`
  --> $DIR/invalid_dispatch_from_dyn_impls.rs:39:1
   |
LL | / impl<T: ?Sized, U: ?Sized> DispatchFromDyn<HasReprC<U>> for HasReprC<T>
LL | |
LL | | where
LL | |     T: Unsize<U>,
   | |_________________^

error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, ZST fields with 1 byte alignment that don't mention type/const generics, and nothing else
  --> $DIR/invalid_dispatch_from_dyn_impls.rs:49:1
   |
LL | / impl<T: ?Sized, U: ?Sized> DispatchFromDyn<OverAligned<U>> for OverAligned<T>
LL | |
LL | |     where
LL | |         T: Unsize<U>,
   | |_____________________^
   |
   = note: extra field `1` of type `OverAlignedZst` is not allowed

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0374, E0375, E0378.
For more information about an error, try `rustc --explain E0374`.