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` 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` --> src/custom.rs | | / unsafe impl<'a, From, To> RefCastOkay<&'a From> for &'a To | | where | | From: ?Sized, | | To: ?Sized + RefCastCustom, | |_____________________________________^ `&'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, | |_____________________________________^ `&'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(_arg: From) | --------------- required by a bound in this function | where | To: RefCastOkay, | ^^^^^^^^^^^^^^^^^ 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` 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` 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` --> src/custom.rs | | / unsafe impl<'a, From, To> RefCastOkay<&'a From> for &'a To | | where | | From: ?Sized, | | To: ?Sized + RefCastCustom, | |_____________________________________^ `&'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, | |_____________________________________^ `&'a mut To` implements `ref_cast::custom::RefCastOkay<&'a mut From>` = note: required for `&Thing` to implement `ref_cast::custom::RefCastOkay<&String>`