Skip to content

Comments

Revise uninitialized memory guidelines and examples#1

Merged
manhatsu merged 4 commits intomanhatsu:doc/no-uninit-valuefrom
rcseacord:patch-2
Dec 4, 2025
Merged

Revise uninitialized memory guidelines and examples#1
manhatsu merged 4 commits intomanhatsu:doc/no-uninit-valuefrom
rcseacord:patch-2

Conversation

@rcseacord
Copy link
Collaborator

Updated guidelines on uninitialized memory usage and added examples of compliant and non-compliant code.

rcseacord and others added 2 commits December 4, 2025 14:05
* 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.
@manhatsu manhatsu merged commit d3b29b5 into manhatsu:doc/no-uninit-value Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants