Skip to content

Commit

Permalink
Add regression test for old NLL ICE
Browse files Browse the repository at this point in the history
  • Loading branch information
rossmacarthur committed Dec 27, 2019
1 parent a04c789 commit 749295c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/ui/issues/issue-51770.rs
@@ -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
}
}

0 comments on commit 749295c

Please sign in to comment.