summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/vimwiki-core-regression.rs
blob: 0a4ed7e0a4021167e4c5e4c71941311b91f43349 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// check-pass
//
// Regression test from crater run for
// <https://github.com/rust-lang/rust/pull/98109>.


pub trait ElementLike {}

pub struct Located<T> where T: ElementLike {
    inner: T,
}

pub struct BlockElement<'a>(&'a str);

impl ElementLike for BlockElement<'_> {}


pub struct Page<'a> {
    /// Comprised of the elements within a page
    pub elements: Vec<Located<BlockElement<'a>>>,
}

impl<'a, __IdxT> std::ops::Index<__IdxT> for Page<'a> where
    Vec<Located<BlockElement<'a>>>: std::ops::Index<__IdxT>
{
    type Output =
        <Vec<Located<BlockElement<'a>>> as
        std::ops::Index<__IdxT>>::Output;

    #[inline]
    fn index(&self, idx: __IdxT) -> &Self::Output {
        <Vec<Located<BlockElement<'a>>> as
                std::ops::Index<__IdxT>>::index(&self.elements, idx)
    }
}

fn main() {}