Skip to content

Commit 749295c

Browse files
committed
Add regression test for old NLL ICE
1 parent a04c789 commit 749295c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/test/ui/issues/issue-51770.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
}

0 commit comments

Comments
 (0)