Revise uninitialized memory guidelines and examples#1
Merged
manhatsu merged 4 commits intomanhatsu:doc/no-uninit-valuefrom Dec 4, 2025
Merged
Revise uninitialized memory guidelines and examples#1manhatsu merged 4 commits intomanhatsu:doc/no-uninit-valuefrom
manhatsu merged 4 commits intomanhatsu:doc/no-uninit-valuefrom
Conversation
* new arithmetic overflow rule * Update expressions.rst fixed a bunch of small problems and started adding compliant solutions using saturation semantics * Update expressions.rst adding Wrapping<T> example * Revise arithmetic overflow guidelines and examples Revised guidelines on arithmetic overflow, emphasizing prevention and the use of explicit wrapping functions. Updated examples to reflect compliant practices with saturation semantics. * Update src/coding-guidelines/expressions.rst Co-authored-by: Félix Fischer <[email protected]> * Update expressions.rst to specify integer types for overflow Clarify guidelines on eliminating arithmetic overflow for various integer types. * Update guidelines on arithmetic overflow handling Clarify behavior of arithmetic overflow in Rust. * Clarify arithmetic overflow behavior in expressions.rst * rebase for fls errors * Update src/coding-guidelines/expressions.rst Co-authored-by: Félix Fischer <[email protected]> * Apply suggestion from @rcseacord * Clarify arithmetic overflow handling and examples Clarified behavior of arithmetic overflow in debug and release modes. Updated examples to emphasize the use of explicit wrapping and saturation semantics. * Update src/coding-guidelines/expressions.rst Co-authored-by: Félix Fischer <[email protected]> * Update src/coding-guidelines/expressions.rst Co-authored-by: Félix Fischer <[email protected]> * Update print statement format in Rust example * Update src/coding-guidelines/expressions.rst Co-authored-by: Félix Fischer <[email protected]> * Update src/coding-guidelines/expressions.rst Co-authored-by: Félix Fischer <[email protected]> * Update src/coding-guidelines/expressions.rst Co-authored-by: Félix Fischer <[email protected]> * Update expressions.rst --------- Co-authored-by: Félix Fischer <[email protected]>
Updated guidelines on uninitialized memory usage and added examples of compliant and non-compliant code.
Added noncompliant and compliant examples demonstrating safe /unsafe memory initialization in Rust.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated guidelines on uninitialized memory usage and added examples of compliant and non-compliant code.