]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-51770.rs
Rollup merge of #103146 - joboet:cleanup_pthread_condvar, 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
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 }