From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- ...e-approximated-shorter-to-static-wrong-bound.rs | 43 ---------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs (limited to 'src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs') diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs deleted file mode 100644 index 9898777c7..000000000 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs +++ /dev/null @@ -1,43 +0,0 @@ -// Test a case where we are trying to prove `'x: 'y` and are forced to -// approximate the shorter end-point (`'y`) to with `'static`. This is -// because `'y` is higher-ranked but we know of only irrelevant -// relations to other regions. Note that `'static` shows up in the -// stderr output as `'0`. - -// compile-flags:-Zverbose - -#![feature(rustc_attrs)] - -use std::cell::Cell; - -// Callee knows that: -// -// 'x: 'a -// 'y: 'b -// -// so the only way we can ensure that `'x: 'y` is to show that -// `'a: 'static`. -fn establish_relationships<'a, 'b, F>(_cell_a: &Cell<&'a u32>, _cell_b: &Cell<&'b u32>, _closure: F) -where - F: for<'x, 'y> FnMut( - &Cell<&'a &'x u32>, // shows that 'x: 'a - &Cell<&'b &'y u32>, // shows that 'y: 'b - &Cell<&'x u32>, - &Cell<&'y u32>, - ), -{ -} - -fn demand_y<'x, 'y>(_cell_x: &Cell<&'x u32>, _cell_y: &Cell<&'y u32>, _y: &'y u32) {} - -#[rustc_regions] -fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { - establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| { - //~^ ERROR borrowed data escapes outside of function - - // Only works if 'x: 'y: - demand_y(x, y, x.get()) - }); -} - -fn main() {} -- cgit v1.2.3