Files
rust/library/std/src
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
..
2025-04-09 12:29:59 +01:00
2025-03-18 16:46:56 +00:00
2024-11-02 11:27:14 +01:00
2025-04-04 14:47:04 +02:00
2025-02-13 13:10:28 -08:00
2025-03-08 16:22:37 -08:00
2025-04-09 12:29:59 +01:00
2025-04-09 12:29:59 +01:00
2025-01-11 06:35:21 +02:00
2025-04-21 20:56:43 -07:00
2025-03-29 13:08:18 +01:00
2025-03-29 13:08:18 +01:00
2025-03-29 13:08:18 +01:00
2025-03-29 13:08:18 +01:00
2025-04-24 22:14:23 +00:00
2025-02-25 09:08:22 +05:30
2025-04-09 12:29:59 +01:00
2025-03-10 21:23:32 +08:00
2025-02-07 16:54:07 +01:00