]>
Commit | Line | Data |
---|---|---|
dfeec247 XL |
1 | // check-pass |
2 | ||
3 | #![crate_type = "lib"] | |
4 | ||
5 | // In an older version, when NLL was still a feature, the following previously did not compile | |
dfeec247 XL |
6 | |
7 | use std::ops::Index; | |
8 | ||
9 | pub struct Test<T> { | |
10 | a: T, | |
11 | } | |
12 | ||
13 | impl<T> Index<usize> for Test<T> { | |
14 | type Output = T; | |
15 | ||
16 | fn index(&self, _index: usize) -> &Self::Output { | |
17 | &self.a | |
18 | } | |
19 | } |