]> git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/issue-51770.rs
New upstream version 1.66.0+dfsg1
[rustc.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
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 }