]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-51770.rs
Auto merge of #78066 - bugadani:wat, r=jonas-schievink
[rust.git] / src / test / ui / issues / issue-51770.rs
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
6 // #![feature(nll)]
7
8 use std::ops::Index;
9
10 pub struct Test<T> {
11     a: T,
12 }
13
14 impl<T> Index<usize> for Test<T> {
15     type Output = T;
16
17     fn index(&self, _index: usize) -> &Self::Output {
18         &self.a
19     }
20 }