3 // Some trait with a function that returns a slice:
6 fn as_slice(&self) -> &[Self::Element];
10 pub struct A<Cont>(Cont);
12 // Here we say that if A wraps a slice, then it implements AsSlice
13 impl<'a, Element> AsSlice for A<&'a [Element]> {
14 type Element = Element;
15 fn as_slice(&self) -> &[Self::Element] {
21 // We want this function to work
22 pub fn failing<Coef>(&self)
24 Self: AsSlice<Element = Coef>,
26 self.as_ref_a().as_ref_a();
29 pub fn as_ref_a<Coef>(&self) -> A<&[<Self as AsSlice>::Element]>
31 Self: AsSlice<Element = Coef>,