Skip to content

1.98 beta rustdoc regression: "reached the configured maximum number of stack frames" #159477

Closed

Description

@theemathas

This regression was found by the 1.98 beta rustdoc crater run.

[INFO] [stdout] error[E0080]: reached the configured maximum number of stack frames
[INFO] [stdout]  --> /rustc/6b3fa26749ab40e159b2dd5cf577acaaf5902772/library/core/src/fmt/num_buffer.rs:26:45
[INFO] [stdout]   |
[INFO] [stdout]   = note: evaluation of `<usize as core::fmt::NumBufferTrait>::Buf::{constant#0}` failed inside this call
[INFO] [stdout]  ::: /rustc/6b3fa26749ab40e159b2dd5cf577acaaf5902772/library/core/src/fmt/num_buffer.rs:39:1
[INFO] [stdout]   |
[INFO] [stdout]   = note: in this macro invocation
[INFO] [stdout] note: inside `core::num::<impl usize>::checked_ilog10`
[INFO] [stdout]  --> /rustc/6b3fa26749ab40e159b2dd5cf577acaaf5902772/library/core/src/num/uint_macros.rs:1914:32
[INFO] [stdout]  --> /rustc/6b3fa26749ab40e159b2dd5cf577acaaf5902772/library/core/src/num/mod.rs:1449:4
[INFO] [stdout]  ::: /rustc/6b3fa26749ab40e159b2dd5cf577acaaf5902772/library/core/src/num/mod.rs:1473:5
[INFO] [stdout]   |
[INFO] [stdout]   = note: in this macro invocation
[INFO] [stdout] note: inside `core::num::NonZero::<usize>::ilog10`
[INFO] [stdout]  --> /rustc/6b3fa26749ab40e159b2dd5cf577acaaf5902772/library/core/src/num/nonzero.rs:1818:12
[INFO] [stdout]  ::: /rustc/6b3fa26749ab40e159b2dd5cf577acaaf5902772/library/core/src/num/nonzero.rs:2506:1
[INFO] [stdout]   |
[INFO] [stdout]   = note: in this macro invocation
[INFO] [stdout] note: inside `core::num::imp::int_log10::usize`
[INFO] [stdout]  --> /rustc/6b3fa26749ab40e159b2dd5cf577acaaf5902772/library/core/src/num/imp/int_log10.rs:132:4
[INFO] [stdout] note: inside `core::num::imp::int_log10::u64`
[INFO] [stdout]  --> /rustc/6b3fa26749ab40e159b2dd5cf577acaaf5902772/library/core/src/num/imp/int_log10.rs:104:21
[INFO] [stdout]  ::: /rustc/6b3fa26749ab40e159b2dd5cf577acaaf5902772/library/core/src/num/imp/int_log10.rs:117:1
[INFO] [stdout]   |
[INFO] [stdout]   = note: in this macro invocation
[INFO] [stdout] note: inside `core::ub_checks::check_language_ub`
[INFO] [stdout]  --> /rustc/6b3fa26749ab40e159b2dd5cf577acaaf5902772/library/core/src/intrinsics/mod.rs:2458:8
[INFO] [stdout]  --> /rustc/6b3fa26749ab40e159b2dd5cf577acaaf5902772/library/core/src/ub_checks.rs:98:4
[INFO] [stdout]  ::: /rustc/6b3fa26749ab40e159b2dd5cf577acaaf5902772/library/core/src/ub_checks.rs:107:5
[INFO] [stdout]   |
[INFO] [stdout]   = note: in this macro invocation
[INFO] [stdout]   = note: this error originates in the macro `impl_NumBufferTrait` which comes from the expansion of the macro `const_eval_select` (in Nightly builds, run with -Z macro-backtrace for more info)

Activity

  1. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Jul 18, 2026
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Jul 18, 2026
  3. theemathas commented on Jul 19, 2026

    @theemathas
    ContributorAuthor

    Minimal reproducer: run cargo +beta doc on the following code in lib.rs

    #![recursion_limit = "8"]

    (Yes, I have questions. This attribute is in the regressed code. https://docs.rs/crate/indented-blocks/latest/source/src/lib.rs#3)

  4. added
    S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
    and removed
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Jul 19, 2026
  5. theemathas commented on Jul 19, 2026

    @theemathas
    ContributorAuthor

    Bisection results:

    searched toolchains 5ac8ecea36e7548534e0bc3d4aa1c12bd4908566 through 7148b31956911d5d5496900bf564ca5212bf199b
    
    
    ********************************************************************************
    Regression in 8c75e93c5c7671c29f3e8c096b7acf56822ed23a
    ********************************************************************************
    
    Attempting to search unrolled perf builds
    Found commits ["279b5483", "94ec7489", "32f10316"]
    installing 279b54833e22d63eb3e4aa3e6b230e267e64844d
    uninstalling 279b54833e22d63eb3e4aa3e6b230e267e64844d
    installing 94ec748948f697efeba4587f417fdab06c815841
    uninstalling 94ec748948f697efeba4587f417fdab06c815841
    installing 32f103161b10f6e919ef9f380d69e9d358b4c2b8
    uninstalling 32f103161b10f6e919ef9f380d69e9d358b4c2b8
    ERROR: none of the toolchains satisfied the predicate
    

    The only relevant PR from that rollup seems to be #157976. cc @Amanieu @GuillaumeGomez

  6. added
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    S-has-bisectionStatus: A bisection has been found for this issue
    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
    and removed
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jul 19, 2026
  7. theemathas commented on Jul 19, 2026

    @theemathas
    ContributorAuthor

    In rustdoc, is recursion_limit specified in a normal crate supposed to affect the recursion limit in std?

  8. added
    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)
    on Jul 19, 2026
  9. theemathas commented on Jul 19, 2026

    @theemathas
    ContributorAuthor

    Code from version 0.5.2:

    #![forbid(unsafe_code)]
    #![no_std]

    Code from version 0.6.0:

    #![forbid(unsafe_code, unconditional_recursion)]
    #![no_std]
    #![recursion_limit = "8"]

    From this, I think that the crate author incorrectly thought that the recursion_limit attribute would somehow stop infinite recursion at run time, and therefore misused the attribute.

    Thanks to zachs18 on the rust community discord for pointing this out.

  10. camelid commented on Jul 22, 2026

    @camelid
    Member

    This is fixed by #159623, though I don't think it's worth backporting the PR since the trigger is a very weird edge case.

  11. apiraino commented on Jul 23, 2026

    @apiraino
    Contributor

    Cool, thanks @camelid. If no backport is necessary and nothing else is needed here, feel free to close this issue.

    @rustbot label -I-prioritize

  12. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.S-has-bisectionStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions