Skip to content

Commit 519aeb6

Browse files
committed
Clean up trailing whitespace
1 parent 3efb695 commit 519aeb6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

text/3467-unsafe-pinned.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl S {
3636
pub fn new() -> Self {
3737
S { data: 42, ptr_to_data: ptr::null_mut() }
3838
}
39-
39+
4040
pub fn get_data(self: Pin<&mut Self>) -> i32 {
4141
// SAFETY: We're not moving anything.
4242
let this = unsafe { Pin::get_unchecked_mut(self) };
@@ -46,7 +46,7 @@ impl S {
4646
// SAFETY: if the pointer is non-null, then we are pinned and it points to the `data` field.
4747
unsafe { this.ptr_to_data.read() }
4848
}
49-
49+
5050
pub fn set_data(self: Pin<&mut Self>, data: i32) {
5151
// SAFETY: We're not moving anything.
5252
let this = unsafe { Pin::get_unchecked_mut(self) };
@@ -147,7 +147,7 @@ fn main() {
147147
</details>
148148

149149
<br>
150-
150+
151151
Beyond self-referential types, a similar problem also comes up with intrusive linked lists: the nodes of such a list often live on the stack frames of the functions participating in the list, but also have incoming pointers from other list elements.
152152
When a function takes a mutable reference to its stack-allocated node, that will alias the pointers from the neighboring elements.
153153
[This](https://github.com/rust-lang/rust/issues/114581) is an example of an intrusive list in the standard library that is breaking Rust's aliasing rules.

0 commit comments

Comments
 (0)