rust-clippy/tests/ui/crashes/ice-rust-107877.rs

18 lines
321 B
Rust
Raw Normal View History

2023-02-25 20:54:31 +00:00
#![allow(dead_code)]
struct Foo;
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());
}