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 --- .../2229_closure_analysis/issue-90465.fixed | 35 ---------------------- 1 file changed, 35 deletions(-) delete mode 100644 src/test/ui/closures/2229_closure_analysis/issue-90465.fixed (limited to 'src/test/ui/closures/2229_closure_analysis/issue-90465.fixed') diff --git a/src/test/ui/closures/2229_closure_analysis/issue-90465.fixed b/src/test/ui/closures/2229_closure_analysis/issue-90465.fixed deleted file mode 100644 index 4e0b18e72..000000000 --- a/src/test/ui/closures/2229_closure_analysis/issue-90465.fixed +++ /dev/null @@ -1,35 +0,0 @@ -// run-rustfix - -#![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE lint level is defined here - -fn main() { - struct Foo(u32); - impl Drop for Foo { - fn drop(&mut self) { - println!("dropped {}", self.0); - } - } - - let f0 = Foo(0); - let f1 = Foo(1); - - let c0 = move || { - let _ = &f0; - //~^ ERROR changes to closure capture in Rust 2021 will affect drop order - //~| NOTE for more information - let _ = f0; - //~^ NOTE in Rust 2018, this causes the closure to capture `f0`, but in Rust 2021, it has no effect - }; - - let c1 = move || { - let _ = &f1; - }; - - println!("dropping 0"); - drop(c0); - println!("dropping 1"); - drop(c1); - println!("dropped all"); -} -//~^ NOTE in Rust 2018, `f0` is dropped here along with the closure, but in Rust 2021 `f0` is not part of the closure -- cgit v1.2.3