Files
2026-08-01 16:11:49 +03:00

68 lines
2.8 KiB
Plaintext

error[E0277]: the trait bound `&Thing: ref_cast::custom::RefCastOkay<&String>` is not satisfied
--> tests/ui/no-custom.rs:8:36
|
8 | pub fn ref_cast(s: &String) -> &Self;
| ^^^^^ unsatisfied trait bound
|
help: the trait `ref_cast::__private25::RefCastCustom<String>` is not implemented for `Thing`
--> tests/ui/no-custom.rs:4:1
|
4 | pub struct Thing(String);
| ^^^^^^^^^^^^^^^^
help: the following other types implement trait `ref_cast::custom::RefCastOkay<From>`
--> src/custom.rs
|
| / unsafe impl<'a, From, To> RefCastOkay<&'a From> for &'a To
| | where
| | From: ?Sized,
| | To: ?Sized + RefCastCustom<From>,
| |_____________________________________^ `&'a To` implements `ref_cast::custom::RefCastOkay<&'a From>`
...
| / unsafe impl<'a, From, To> RefCastOkay<&'a mut From> for &'a mut To
| | where
| | From: ?Sized,
| | To: ?Sized + RefCastCustom<From>,
| |_____________________________________^ `&'a mut To` implements `ref_cast::custom::RefCastOkay<&'a mut From>`
= note: required for `&Thing` to implement `ref_cast::custom::RefCastOkay<&String>`
note: required by a bound in `ref_cast::__private25::ref_cast_custom`
--> src/custom.rs
|
| pub fn ref_cast_custom<From, To>(_arg: From)
| --------------- required by a bound in this function
| where
| To: RefCastOkay<From>,
| ^^^^^^^^^^^^^^^^^ required by this bound in `ref_cast_custom`
error[E0071]: expected struct, variant or union type, found inferred type
--> tests/ui/no-custom.rs:8:41
|
8 | pub fn ref_cast(s: &String) -> &Self;
| ^ not a struct
error[E0277]: the trait bound `Thing: ref_cast::__private25::RefCastCustom<String>` is not satisfied
--> tests/ui/no-custom.rs:8:41
|
8 | pub fn ref_cast(s: &String) -> &Self;
| ^ unsatisfied trait bound
|
help: the trait `ref_cast::__private25::RefCastCustom<String>` is not implemented for `Thing`
--> tests/ui/no-custom.rs:4:1
|
4 | pub struct Thing(String);
| ^^^^^^^^^^^^^^^^
help: the following other types implement trait `ref_cast::custom::RefCastOkay<From>`
--> src/custom.rs
|
| / unsafe impl<'a, From, To> RefCastOkay<&'a From> for &'a To
| | where
| | From: ?Sized,
| | To: ?Sized + RefCastCustom<From>,
| |_____________________________________^ `&'a To` implements `ref_cast::custom::RefCastOkay<&'a From>`
...
| / unsafe impl<'a, From, To> RefCastOkay<&'a mut From> for &'a mut To
| | where
| | From: ?Sized,
| | To: ?Sized + RefCastCustom<From>,
| |_____________________________________^ `&'a mut To` implements `ref_cast::custom::RefCastOkay<&'a mut From>`
= note: required for `&Thing` to implement `ref_cast::custom::RefCastOkay<&String>`