Skip to content

Commit

Permalink
Rollup merge of #67654 - rossmacarthur:fix-51770-add-regression-test,…
Browse files Browse the repository at this point in the history
… r=Centril

Add regression test for old NLL ICE

This fails on nightly-2018-06-24.

Resolves #51770
  • Loading branch information
oli-obk authored Dec 27, 2019
2 parents 9525e8e + 749295c commit 9eb45e3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/ui/issues/issue-51770.rs
Original file line number Diff line number Diff line change
@@ -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 9eb45e3

Please sign in to comment.