Rust (programming language): Difference between revisions

Content deleted Content added
m improve standard library linking
Pointers: using syntax highlighted snippets where possible; c/e
Line 473:
 
=== Pointers ===
The <code>&</code> and <code>{{rust|&mut</code>}} reference types are guaranteed to not be null and points to valid memory.{{sfn|Gjengset|2021|p=155-156}} The raw pointer types <code>{{rust|*const</code>}} and <code>{{rust|*mut</code>}} opts out of the safety guarantees, thus they may be null and invalid; however, it is impossible to dereference them unless the code is explicitly declared unsafe through the use of an <code>{{rust|unsafe</code>}} block.{{sfn|Klabnik|Nichols|2023|pp=421-423}} Unlike dereferencing, the creation of raw pointers is allowed inside of safe Rust code.{{sfn|Klabnik|Nichols|2019|pp=418–427}}
 
=== Type conversion ===