]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-51770.rs
Rollup merge of #83807 - sjakobi:77548-remove-ignore-annotations, r=Mark-Simulacrum
[rust.git] / src / test / ui / nll / 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 }