Add regression test for old NLL ICE
This commit is contained in:
parent
a04c789f69
commit
749295cfbf
1 changed files with 20 additions and 0 deletions
20
src/test/ui/issues/issue-51770.rs
Normal file
20
src/test/ui/issues/issue-51770.rs
Normal 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
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue