about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/crashes/ice-rust-107877.rs
blob: dccb0cf8ac152809c4434b975797930fc69ceec1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//@ check-pass

#![allow(dead_code)]

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());
}