From 0c98fb1be787de6cafcf855f515983d2dbb1136a Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 14 Jan 2025 09:43:02 -0800 Subject: [PATCH] Apply suggestions from RalfJung --- src/destructors.md | 4 ++-- src/linkage.md | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/destructors.md b/src/destructors.md index 301fc24a5..8e445e406 100644 --- a/src/destructors.md +++ b/src/destructors.md @@ -426,8 +426,8 @@ let x = (&temp()).use_temp(); // ERROR r[destructors.forget] ## Not running destructors -r[destructors.manually-preventing] -### Manually preventing destructors +r[destructors.manually-suppressing] +### Manually suppressing destructors [`std::mem::forget`] can be used to prevent the destructor of a variable from being run, and [`std::mem::ManuallyDrop`] provides a wrapper to prevent a diff --git a/src/linkage.md b/src/linkage.md index f17560b87..bdca74232 100644 --- a/src/linkage.md +++ b/src/linkage.md @@ -278,10 +278,11 @@ Passing `rlib`s directly into your foreign linker is currently unsupported. r[link.unwinding] ### Prohibited linkage and unwinding -r[link.unwinding.consistency] +r[link.unwinding.intro] If you are *not* using `rustc` to link Rust files, you must take care to ensure that unwinding is -handled consistently across the entire binary. This includes using `dlopen` or similar facilities -where linking is done by the system runtime without `rustc` being involved. +handled consistently across the entire binary. Linking without `rustc` includes using `dlopen` or similar facilities +where linking is done by the system runtime without `rustc` being involved. In the following, +we define what exactly is meant by "handling unwinding consistently". r[link.unwinding.potential] A Rust artifact is called *potentially unwinding* if any of the following conditions is met: