2 // Regression test for issue #47139:
4 // Same as issue-47139-1.rs, but the impls of dummy are in the
5 // opposite order. This influenced the way that coherence ran and in
6 // some cases caused the overflow to occur when it wouldn't otherwise.
7 // In an effort to make the regr test more robust, I am including both
12 pub trait Insertable {
15 fn values(self) -> Self::Values;
18 impl<T> Insertable for Option<T>
23 type Values = T::Values;
25 fn values(self) -> Self::Values {
26 self.map(Insertable::values).unwrap_or_default()
30 impl<'a, T> Insertable for &'a Option<T>
32 Option<&'a T>: Insertable,
34 type Values = <Option<&'a T> as Insertable>::Values;
36 fn values(self) -> Self::Values {
37 self.as_ref().values()
41 impl<'a, T> Insertable for &'a [T]
45 fn values(self) -> Self::Values {
50 trait Unimplemented { }
54 struct Foo<T> { t: T }
57 where T: Unimplemented
60 impl<'a, U> Dummy for Foo<&'a U>
61 where &'a U: Insertable