From ea742a4e5528ba937e4a2e9a15f74ac99287ef88 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 11 Jan 2018 17:36:53 -0500 Subject: [PATCH] update test case --- src/test/ui/nll/generator-distinct-lifetime.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/test/ui/nll/generator-distinct-lifetime.rs b/src/test/ui/nll/generator-distinct-lifetime.rs index 261d1bf85b1..60f67b1766c 100644 --- a/src/test/ui/nll/generator-distinct-lifetime.rs +++ b/src/test/ui/nll/generator-distinct-lifetime.rs @@ -12,14 +12,11 @@ // Test for issue #47189. Here, both `s` and `t` are live for the // generator's lifetime, but within the generator they have distinct -// lifetimes. -// -// Currently, we accept this code (with NLL enabled) since `x` is only -// borrowed once at a time -- though whether we should is not entirely -// obvious to me (the borrows are live over a yield, but then they are -// re-borrowing borrowed content, etc). Maybe I just haven't had -// enough coffee today, but I'm not entirely sure at this moment what -// effect a `suspend` should have on existing borrows. -nmatsakis +// lifetimes. We accept this code -- even though the borrow extends +// over a yield -- because the data that is borrowed (`*x`) is not +// stored on the stack. + +// must-compile-successfully fn foo(x: &mut u32) { move || {