Skip to content

Commit aeeb287

Browse files
committed
Merge PR #313: Stabilize unsafe extern blocks
2 parents 69ea9b6 + f646cd4 commit aeeb287

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/SUMMARY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
- [Macro fragment specifiers](rust-2024/macro-fragment-specifiers.md)
5252
- [Missing macro fragment specifiers](rust-2024/missing-macro-fragment-specifiers.md)
5353
- [Never type fallback change](rust-2024/never-type-fallback.md)
54-
- [`unsafe extern` blocks](rust-2024/unsafe-extern.md)
54+
- [Unsafe `extern` blocks](rust-2024/unsafe-extern.md)
5555
- [Unsafe attributes](rust-2024/unsafe-attributes.md)

src/rust-2024/unsafe-extern.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `unsafe extern` blocks
1+
# Unsafe `extern` blocks
22

33
🚧 The 2024 Edition has not yet been released and hence this section is still "under construction".
44
More information may be found in the tracking issue at <https://github.com/rust-lang/rust/issues/123743>.
@@ -11,13 +11,11 @@ More information may be found in the tracking issue at <https://github.com/rust-
1111

1212
## Details
1313

14-
Rust 1.xx <!--TODO--> 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.
14+
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.
1515

1616
The syntax for an unsafe `extern` block looks like this:
1717

1818
```rust
19-
# #![feature(unsafe_extern_blocks)]
20-
2119
unsafe extern "C" {
2220
// sqrt (from libm) may be called with any `f64`
2321
pub safe fn sqrt(x: f64) -> f64;

0 commit comments

Comments
 (0)