Add regression test for old NLL ICE

This commit is contained in:
Ross MacArthur 2019-12-27 13:36:41 +02:00
parent a04c789f69
commit 749295cfbf
No known key found for this signature in database
GPG key ID: 06D0DC3998527584

View file

@ -0,0 +1,20 @@
// check-pass
#![crate_type = "lib"]
// In an older version, when NLL was still a feature, the following previously did not compile
// #![feature(nll)]
use std::ops::Index;
pub struct Test<T> {
a: T,
}
impl<T> Index<usize> for Test<T> {
type Output = T;
fn index(&self, _index: usize) -> &Self::Output {
&self.a
}
}