Rust (programming language): Difference between revisions

Content deleted Content added
enums are tagged unions
Pointers: grammar
Line 473:
 
=== Pointers ===
The <code>&</code> and {{rust|&mut}} reference types are guaranteed to not be null and pointspoint to valid memory.{{sfn|Gjengset|2021|p=155-156}} The raw pointer types {{rust|*const}} and {{rust|*mut}} optsopt out of the safety guarantees, thus they may be null andor invalid; however, it is impossible to dereference them unless the code is explicitly declared unsafe through the use of an {{rust|unsafe}} block.{{sfn|Klabnik|Nichols|2023|pp=421-423}} Unlike dereferencing, the creation of raw pointers is allowed inside safe Rust code.{{sfn|Klabnik|Nichols|2019|pp=418–427}}
 
=== Type conversion ===