]> git.lizzy.rs Git - rust.git/blob - src/test/ui/invalid_coerce_sized_impls.stderr
Add new tests and update existing for object-safe custom receivers
[rust.git] / src / test / ui / invalid_coerce_sized_impls.stderr
1 error[E0378]: the trait `CoerceSized` may only be implemented for structs containing the field being coerced, `PhantomData` fields, and nothing else
2   --> $DIR/invalid_coerce_sized_impls.rs:25:1
3    |
4 LL | / impl<T, U> CoerceSized<WrapperWithExtraField<T>> for WrapperWithExtraField<U>
5 LL | | where
6 LL | |     T: CoerceUnsized<U>,
7 LL | |     U: CoerceSized<T>,
8 LL | | {} //~^^^^ ERROR [E0378]
9    | |__^
10    |
11    = note: extra field `1` of type `i32` is not allowed
12
13 error[E0378]: implementing the `CoerceSized` trait requires multiple coercions
14   --> $DIR/invalid_coerce_sized_impls.rs:39:1
15    |
16 LL | / impl<T: ?Sized, U: ?Sized> CoerceSized<MultiplePointers<T>> for MultiplePointers<U>
17 LL | | where
18 LL | |     T: Unsize<U>,
19 LL | | {} //~^^^ ERROR [E0378]
20    | |__^
21    |
22    = note: the trait `CoerceSized` may only be implemented for a coercion between structures with a single field being coerced
23    = note: currently, 2 fields need coercions: ptr1 (*const U to *const T), ptr2 (*const U to *const T)
24
25 error[E0378]: the trait `CoerceSized` may only be implemented for a coercion between structures with a single field being coerced, none found
26   --> $DIR/invalid_coerce_sized_impls.rs:51:1
27    |
28 LL | impl<T: ?Sized, U: ?Sized> CoerceSized<NothingToCoerce<U>> for NothingToCoerce<T> {}
29    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30
31 error: aborting due to 3 previous errors
32
33 For more information about this error, try `rustc --explain E0378`.