Handle ambiguous projections

This commit is contained in:
Samuel Moelius 2023-02-25 15:54:31 -05:00
parent b528cc90bc
commit f95d9deafd
2 changed files with 21 additions and 4 deletions

View file

@ -0,0 +1,17 @@
#![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());
}