nomicon
nomicon copied to clipboard
The Dark Arts of Advanced and Unsafe Rust Programming
~The Rust language reference (and my experience, proved by tests) says, that `packed(n)` gives you the ability to align the struct too. This bug probably comes from a past version...
[Atomics](https://doc.rust-lang.org/nightly/nomicon/atomics.html) The example of a counter is given, the counter would keep an accurate count, but no guarantee is given that another thread reading the counter will get the final,...
This is a documentation change to accompany [this stabilization report](https://github.com/rust-lang/rust/pull/122792). It should only be merged if the stabilization gets accepted.
This just does some cleanups of the code in the split borrows tree example, some suggested by clippy others just seemed like simplifications that could be done.
[Rendered](https://sabrinajewson.org/rust-nomicon/atomics/atomics.html) This PR is for my attempted rewrite of the atomics section of the Nomicon, to give it a more spec-focused explanation and avoid misconceptions like time and reordering. Currently...
```rust let x = 0; let z; let y = &x; z = y; ``` ```rust,ignore 'a: { let x: i32 = 0; 'b: { let z: &'b i32; 'c:...
Fix #345 #122 Make FFI chapter snappy example workable.
This is a suggestion fix for https://github.com/rust-lang/nomicon/issues/424
In "[What Unsafe Can Do](https://doc.rust-lang.org/nomicon/what-unsafe-does.html)", the fourth bullet point on the first list is "Mutate statics." What it should say is "Access or modify mutable statics", same as "Rust By...
10.1.2. Base Code / [Send and Sync](https://doc.rust-lang.org/nomicon/arc-mutex/arc-base.html#send-and-sync). Fragment: ```rs unsafe impl Send for Arc {} unsafe impl Sync for Arc {} ``` It is unclear from the text of the...