]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/issue-51770.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / nll / issue-51770.rs
CommitLineData
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
7use std::ops::Index;
8
9pub struct Test<T> {
10 a: T,
11}
12
13impl<T> Index<usize> for Test<T> {
14 type Output = T;
15
16 fn index(&self, _index: usize) -> &Self::Output {
17 &self.a
18 }
19}