blob: 17d4fd15de414f292e2d59f732d7f5577e0dd204 [file]
//@ check-pass
struct Foo;
#[allow(clippy::infallible_try_from)]
impl<'a> std::convert::TryFrom<&'a String> for Foo {
type Error = std::convert::Infallible;
fn try_from(_: &'a String) -> Result<Self, Self::Error> {
Ok(Foo)
}
}
fn find<E>(_: impl std::convert::TryInto<Foo, Error = E>) {}
fn main() {
find(&String::new());
}