Repository navigation
Document the recursion_limit built-in attribute - #162369
Conversation
|
Thanks for the pull request, and welcome! The Rust Project has assigned @JohnTitor (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions and our LLM policy for more information. Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
9f9f9fa to
b0d3fe7
Compare
|
Personal drive-by suggestions: While the docs do introduce "compile-time operations" explicitly, I suggest to go one step further add a clarifying sentence wrt not having anything to do with run-time recursion; people have confused the attribute to affect recursive code, which it does not. Also I suggest to explicitly advise readers to increase the limit in measured steps instead of just punching in |
b0d3fe7 to
8576dc3
Compare
Good points, thanks. I added a clarifying sentence that the limit is compile-time only and has no effect on runtime recursion, and I explicitly advise raising it in measured steps instead of jumping to a very large number. |
This comment has been minimized.
This comment has been minimized.
|
LGTM, could you resolve the conflict? |
Adds an entry for `recursion_limit` to `library/core/src/attribute_docs.rs` using `#[doc(attribute = "...")]`.
8576dc3 to
f35da9e
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Alright, resolved conflicts, thanks. |
…attribute, r=JohnTitor Document the `recursion_limit` built-in attribute Document the `recursion_limit` built-in attribute in std via `#[doc(attribute = "recursion_limit")]`, covering: - what the limit applies to (macro expansion, auto-dereference) - the default (128) and how to raise it - the diagnostics produced when the limit is reached - a note on when raising it is appropriate As claimed in rust-lang#157604 (comment). Part of rust-lang#157604.
…uwer Rollup of 8 pull requests Successful merges: - #162460 (Feat - `#[inline(always)] + #[target_feature(enable = "....")]` #2) - #163485 (`rustc_builtin_macros` cleanup, part 8) - #164578 (Don't ignore unknown LLVM diagnostics) - #162369 (Document the `recursion_limit` built-in attribute) - #162840 (tier 3 target policy: target CPU and features must be supported by upstream backend) - #164330 (Skip redundant monomorphization checks) - #164656 (stabilize ExitCodeExt for Windows) - #164660 (Touch up attribute docs)
…attribute, r=JohnTitor Document the `recursion_limit` built-in attribute Document the `recursion_limit` built-in attribute in std via `#[doc(attribute = "recursion_limit")]`, covering: - what the limit applies to (macro expansion, auto-dereference) - the default (128) and how to raise it - the diagnostics produced when the limit is reached - a note on when raising it is appropriate As claimed in rust-lang#157604 (comment). Part of rust-lang#157604.
…uwer Rollup of 13 pull requests Successful merges: - #162460 (Feat - `#[inline(always)] + #[target_feature(enable = "....")]` #2) - #163485 (`rustc_builtin_macros` cleanup, part 8) - #164457 (Add `vec_visualizer` lldb test) - #161253 (Implement `AsMut<T>` and `AsRef<T>` for `!`.) - #162369 (Document the `recursion_limit` built-in attribute) - #162840 (tier 3 target policy: target CPU and features must be supported by upstream backend) - #164329 (use default_field_values in declare_lint) - #164330 (Skip redundant monomorphization checks) - #164527 (doc: added addtional docs for Write) - #164656 (stabilize ExitCodeExt for Windows) - #164660 (Touch up attribute docs) - #164681 (tidy: use repository-relative path for style checks) - #164688 (re-enable test_dir_remove_dir test on QNX)
Rollup merge of #162369 - kiana1kaslana:doc-recursion-limit-attribute, r=JohnTitor Document the `recursion_limit` built-in attribute Document the `recursion_limit` built-in attribute in std via `#[doc(attribute = "recursion_limit")]`, covering: - what the limit applies to (macro expansion, auto-dereference) - the default (128) and how to raise it - the diagnostics produced when the limit is reached - a note on when raising it is appropriate As claimed in #157604 (comment). Part of #157604.
Document the
recursion_limitbuilt-in attribute in std via#[doc(attribute = "recursion_limit")], covering:As claimed in #157604 (comment).
Part of #157604.