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; | ^^^^^ the trait `RefCastCustom` is not implemented for `&Thing`, which is required by `&Thing: ref_cast::custom::RefCastOkay<&String>` | = help: the following other types implement trait `ref_cast::custom::RefCastOkay`: <&'a To as ref_cast::custom::RefCastOkay<&'a From>> <&'a mut To as 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_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: RefCastCustom` is not satisfied --> tests/ui/no-custom.rs:8:41 | 8 | pub fn ref_cast(s: &String) -> &Self; | ^ the trait `RefCastCustom` is not implemented for `Thing`, which is required by `&Thing: ref_cast::custom::RefCastOkay<&String>` | = help: the following other types implement trait `ref_cast::custom::RefCastOkay`: <&'a To as ref_cast::custom::RefCastOkay<&'a From>> <&'a mut To as ref_cast::custom::RefCastOkay<&'a mut From>> = note: required for `&Thing` to implement `ref_cast::custom::RefCastOkay<&String>`