summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs')
-rw-r--r--src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs b/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs
deleted file mode 100644
index 7ea1c445d..000000000
--- a/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-// rust-lang/rust#52059: Regardless of whether you are moving out of a
-// Drop type or just introducing an inadvertent alias via a borrow of
-// one of its fields, it is useful to be reminded of the significance
-// of the fact that the type implements Drop.
-
-pub struct S<'a> { url: &'a mut String }
-
-impl<'a> Drop for S<'a> { fn drop(&mut self) { } }
-
-fn finish_1(s: S) -> &mut String {
- s.url
-}
-//~^^ ERROR borrow may still be in use when destructor runs
-
-fn finish_2(s: S) -> &mut String {
- let p = &mut *s.url; p
-}
-//~^^ ERROR borrow may still be in use when destructor runs
-
-fn finish_3(s: S) -> &mut String {
- let p: &mut _ = s.url; p
-}
-//~^^ ERROR borrow may still be in use when destructor runs
-
-fn finish_4(s: S) -> &mut String {
- let p = s.url; p
-}
-//~^^ ERROR cannot move out of type `S<'_>`, which implements the `Drop` trait
-
-fn main() {}