diff options
| author | Ross MacArthur <ross@macarthur.io> | 2019-12-27 13:36:41 +0200 |
|---|---|---|
| committer | Ross MacArthur <ross@macarthur.io> | 2019-12-27 13:36:41 +0200 |
| commit | 749295cfbfd408cde8a0c07e021387013fb8b65c (patch) | |
| tree | 531855d3a39fa87c81cadaf45b474b8460c6dcc2 | |
| parent | a04c789f699a3470edd8cc76d016c68e99cfe4db (diff) | |
| download | rust-749295cfbfd408cde8a0c07e021387013fb8b65c.tar.gz rust-749295cfbfd408cde8a0c07e021387013fb8b65c.zip | |
Add regression test for old NLL ICE
| -rw-r--r-- | src/test/ui/issues/issue-51770.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-51770.rs b/src/test/ui/issues/issue-51770.rs new file mode 100644 index 00000000000..bcb37a5f4ff --- /dev/null +++ b/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 + } +} |
