diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/nll/issue-73159-rpit-static.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/nll/issue-73159-rpit-static.rs b/src/test/ui/nll/issue-73159-rpit-static.rs new file mode 100644 index 000000000..3002408b0 --- /dev/null +++ b/src/test/ui/nll/issue-73159-rpit-static.rs @@ -0,0 +1,13 @@ +// Regression test for issue #73159 +// Tests thar we don't suggest replacing 'a with 'static' + +struct Foo<'a>(&'a [u8]); + +impl<'a> Foo<'a> { + fn make_it(&self) -> impl Iterator<Item = u8> { + self.0.iter().copied() + //~^ ERROR: captures lifetime that does not appear in bounds + } +} + +fn main() {} |