rust/library/std
Matthias Krüger 806260e973
Rollup merge of #140216 - t5kd:master, r=tgross35
Document that "extern blocks must be unsafe" in Rust 2024

The [documentation on `extern`](https://doc.rust-lang.org/std/keyword.extern.html) contains the following code sample:
```rust
#[link(name = "my_c_library")]
extern "C" {
    fn my_c_function(x: i32) -> bool;
}
```

Due to #123743, attempting to compile such code with the 2024 edition of Rust fails:
```
error: extern blocks must be unsafe
```

This PR extends the `extern` documentation with a brief explanation of the new requirement. It also adds the missing `unsafe` keyword to the code sample, which should be compatible with rustc since v1.82.

**Related docs:**
- https://doc.rust-lang.org/reference/items/external-blocks.html
- https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-extern.html
2025-04-26 07:13:07 +02:00
..
benches Fix import in bench for wasm 2025-02-12 14:44:30 -08:00
src Rollup merge of #140216 - t5kd:master, r=tgross35 2025-04-26 07:13:07 +02:00
tests test_nan: ensure the NAN contant is quiet 2025-04-22 09:06:43 +02:00
build.rs Revert "Disable f16 on Aarch64 without neon" 2025-04-02 19:21:10 +00:00
Cargo.toml Rollup merge of #140146 - tgross35:update-builtins, r=tgross35 2025-04-23 00:43:05 +00:00