// Testing inference capabilities. // check-pass #![feature(inherent_associated_types)] #![allow(incomplete_features)] #![allow(dropping_copy_types)] use std::convert::identity; struct Container(T); impl Container { type Sink = (); } impl Container { type Thing = Any; } impl Container<(T, ())> { type Output = ((), Wrapped); } fn main() { // Inferred via the Self type of the impl. let _: Container<_>::Sink; // Inferred via the RHS: let _: Container<_>::Thing = 0; let _: Container>::Thing = Wrapped(false); let _: Container<_>::Output = (drop(1), Wrapped("...")); let binding: Container<_>::Thing = Default::default(); // unsolved at this point identity::(binding); // constrained and solved here } struct Wrapped(T);