From 0e043bab002d57ee14014ba80ee9291315b03485 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Thu, 18 Jul 2024 12:33:54 -0300 Subject: [PATCH 1/3] Stabilize unsafe extern blocks --- src/rust-2024/unsafe-extern.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/rust-2024/unsafe-extern.md b/src/rust-2024/unsafe-extern.md index 01e6b0ce..8c422a00 100644 --- a/src/rust-2024/unsafe-extern.md +++ b/src/rust-2024/unsafe-extern.md @@ -16,8 +16,6 @@ Rust 1.xx added the ability in all editions to mark [`extern` blocks The syntax for an unsafe `extern` block looks like this: ```rust -# #![feature(unsafe_extern_blocks)] - unsafe extern "C" { // sqrt (from libm) may be called with any `f64` pub safe fn sqrt(x: f64) -> f64; From c320aa4ddc2acb6a71fe0ed00b34aaae4aadd1b0 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Sun, 21 Jul 2024 10:20:49 +0000 Subject: [PATCH 2/3] Capitalize the "unsafe" in "unsafe extern" For better parity with "Unsafe attributes", e.g. in the table of contents, let's similarly capitalize the "unsafe" in "unsafe extern". --- src/SUMMARY.md | 2 +- src/rust-2024/unsafe-extern.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 27ae94d9..8b2b4973 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -50,5 +50,5 @@ - [`gen` keyword](rust-2024/gen-keyword.md) - [Macro fragment specifiers](rust-2024/macro-fragment-specifiers.md) - [Never type fallback change](rust-2024/never-type-fallback.md) - - [`unsafe extern` blocks](rust-2024/unsafe-extern.md) + - [Unsafe `extern` blocks](rust-2024/unsafe-extern.md) - [Unsafe attributes](rust-2024/unsafe-attributes.md) diff --git a/src/rust-2024/unsafe-extern.md b/src/rust-2024/unsafe-extern.md index 8c422a00..1ba5fb80 100644 --- a/src/rust-2024/unsafe-extern.md +++ b/src/rust-2024/unsafe-extern.md @@ -1,4 +1,4 @@ -# `unsafe extern` blocks +# Unsafe `extern` blocks 🚧 The 2024 Edition has not yet been released and hence this section is still "under construction". More information may be found in the tracking issue at . From f646cd48fb367166afc9e8e1fc2effec8c0b6caf Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Tue, 6 Aug 2024 21:14:42 +0000 Subject: [PATCH 3/3] Fill in version that `unsafe extern` will stabilize --- src/rust-2024/unsafe-extern.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rust-2024/unsafe-extern.md b/src/rust-2024/unsafe-extern.md index 1ba5fb80..47221db5 100644 --- a/src/rust-2024/unsafe-extern.md +++ b/src/rust-2024/unsafe-extern.md @@ -11,7 +11,7 @@ More information may be found in the tracking issue at added the ability in all editions to mark [`extern` blocks] with the `unsafe` keyword.[^RFC3484] Adding the `unsafe` keyword helps to emphasize that it is the responsibility of the author of the `extern` block to ensure that the signatures are correct. If the signatures are not correct, then it may result in undefined behavior. +Rust 1.82 added the ability in all editions to mark [`extern` blocks] with the `unsafe` keyword.[^RFC3484] Adding the `unsafe` keyword helps to emphasize that it is the responsibility of the author of the `extern` block to ensure that the signatures are correct. If the signatures are not correct, then it may result in undefined behavior. The syntax for an unsafe `extern` block looks like this: