Skip to content

Commit 1141fae

Browse files
committed
test ci snapshot error
1 parent 378448c commit 1141fae

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/auto-pr-tests/test_issue_02.snapshot

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
=====CONTENT=====
22
.. guideline:: Recursive function are not allowed
3-
:id: gui_81NCyLnG0glk
3+
:id: gui_llfYnmAucaJQ
44
:category: required
55
:status: draft
66
:release: 1.3.0-latest
77
:fls: fls_vjgkg8kfi93
88
:decidability: undecidable
99
:scope: system
10-
:tags: reduce-human-error
10+
:tags: increase-human-error
1111

1212
Any function shall not call itself directly or indirectly
1313

1414
.. rationale::
15-
:id: rat_hEmkdyKGXF1a
15+
:id: rat_bbk57IUR7pjD
1616
:status: draft
1717

1818
Recursive functions can easily cause stack overflows, which may result in exceptions or, in some cases, undefined behavior (typically some embedded systems). Although the Rust compiler supports [tail call optimization](https://en.wikipedia.org/wiki/Tail_call), this optimization is not guaranteed and depends on the specific implementation and function structure. There is an [open RFC to guarantee tail call optimization in the Rust compiler](https://github.com/phi-go/rfcs/blob/guaranteed-tco/text/0000-explicit-tail-calls.md), but this feature has not yet been stabilized. Until tail call optimization is guaranteed and stabilized, developers should avoid using recursive functions to prevent potential stack overflows and ensure program reliability.
1919

2020
.. non_compliant_example::
21-
:id: non_compl_ex_uE46RnJ7bRxg
21+
:id: non_compl_ex_bEG9g2wgnCci
2222
:status: draft
2323

2424
The below function `concat_strings` is not complaint because it call itself and depending on depth of data provided as input it could generate an stack overflow exception or undefine behavior.
25+
THIS LINE WAS ADDED IN PURPOSE TO TEST SNAPSHOT TESTING???
2526

2627
.. code-block:: rust
2728

@@ -44,7 +45,7 @@
4445
}
4546

4647
.. compliant_example::
47-
:id: compl_ex_OwxB9v0oUgPE
48+
:id: compl_ex_j9sv9nZWk1Eo
4849
:status: draft
4950

5051
The following code implements the same functionality using iteration instead of recursion. The `stack` variable is used to maintain the processing context at each step of the loop. This approach provides explicit control over memory usage. If the stack grows beyond a predefined limit due to the structure or size of the input, the function returns an error rather than risking a stack overflow or out-of-memory exception. This ensures more predictable and robust behavior in resource-constrained environments.
@@ -85,4 +86,4 @@
8586
}
8687

8788
=====CONTENT=END=====
88-
Saved guideline to src/coding-guidelines/associated items.rst
89+
Saved guideline to src/coding-guidelines/associated-items.rst

0 commit comments

Comments
 (0)