Closed chengr4 closed 1 month ago
Some code blocks are indented, because they are actually snippets that are part of a larger (indented) block, such as an impl block or a function body.
For example,
fn data(&self) -> &ArcData<T> {
unsafe { self.ptr.as_ref() }
}
is indented one level, because that function definition lives inside the impl Arc<T> { … }
block.
Got it! Thanks for the explanation
Type of error
Formatting error
Location of the error
At https://marabos.nl/atomics/building-arc.html#basic-reference-counting
We know the pointer will always point to a valid ArcData as long as the Arc object exists. However, this is not something the compiler knows or checks for us, so accessing the ArcData through the pointer requires unsafe code. We’ll add a private helper function to get from the Arc to the ArcData, since this is something we’ll have to do several times:
Description of the error
Not sure whether this should be reported or not. But I saw redundant indents for
and beneath