]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/vimwiki-core-regression.rs
Auto merge of #105145 - Ayush1325:sequential-remote-server, r=Mark-Simulacrum
[rust.git] / src / test / ui / nll / vimwiki-core-regression.rs
1 // check-pass
2 //
3 // Regression test from crater run for
4 // <https://github.com/rust-lang/rust/pull/98109>.
5
6
7 pub trait ElementLike {}
8
9 pub struct Located<T> where T: ElementLike {
10     inner: T,
11 }
12
13 pub struct BlockElement<'a>(&'a str);
14
15 impl ElementLike for BlockElement<'_> {}
16
17
18 pub struct Page<'a> {
19     /// Comprised of the elements within a page
20     pub elements: Vec<Located<BlockElement<'a>>>,
21 }
22
23 impl<'a, __IdxT> std::ops::Index<__IdxT> for Page<'a> where
24     Vec<Located<BlockElement<'a>>>: std::ops::Index<__IdxT>
25 {
26     type Output =
27         <Vec<Located<BlockElement<'a>>> as
28         std::ops::Index<__IdxT>>::Output;
29
30     #[inline]
31     fn index(&self, idx: __IdxT) -> &Self::Output {
32         <Vec<Located<BlockElement<'a>>> as
33                 std::ops::Index<__IdxT>>::index(&self.elements, idx)
34     }
35 }
36
37 fn main() {}