Skip to content

Commit 9eb45e3

Browse files
authored
Rollup merge of rust-lang#67654 - rossmacarthur:fix-51770-add-regression-test, r=Centril
Add regression test for old NLL ICE This fails on nightly-2018-06-24. Resolves rust-lang#51770
2 parents 9525e8e + 749295c commit 9eb45e3

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)