Skip to content

regression: error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth #140221

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
cuviper opened this issue Apr 23, 2025 · 7 comments
Labels
A-decl-macros-1-2 Area: Declarative macros 1.2 A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug. P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. S-has-bisection Status: A bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@cuviper
Copy link
Member

cuviper commented Apr 23, 2025

Four crater results failed with similar error messages:

[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/math/helper_test.rs:103:10
[INFO] [stdout]     |
[INFO] [stdout] 103 |         $( $Arg : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]   --> rust/test/math/macro_tools_test.rs:13:10
[INFO] [stdout]    |
[INFO] [stdout] 13 |         $( $Arg : tt )*
[INFO] [stdout]    |          ^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/math/macro_tools_test.rs:589:10
[INFO] [stdout]     |
[INFO] [stdout] 589 |         $( $Arg : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/math/macro_tools_test.rs:846:10
[INFO] [stdout]     |
[INFO] [stdout] 846 |         $( $Arg : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]   --> rust/test/meta/meta/for_each_test.rs:15:10
[INFO] [stdout]    |
[INFO] [stdout] 15 |         $( $Arg : tt )*
[INFO] [stdout]    |          ^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/meta/meta/for_each_test.rs:593:10
[INFO] [stdout]     |
[INFO] [stdout] 593 |         $( $Arg : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/meta/meta/for_each_test.rs:851:10
[INFO] [stdout]     |
[INFO] [stdout] 851 |         $( $Arg : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/meta/./impls_index/impls1_test.rs:100:16
[INFO] [stdout]     |
[INFO] [stdout] 100 |             ( $( $Arg : tt )* ) => { };
[INFO] [stdout]     |                ^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/meta/./impls_index/impls2_test.rs:100:16
[INFO] [stdout]     |
[INFO] [stdout] 100 |             ( $( $Arg : tt )* ) => { };
[INFO] [stdout]     |                ^^^^^^^^^^^^^
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/dt/type_constructor/single_test.rs:191:10
[INFO] [stdout]     |
[INFO] [stdout] 191 |         $( $Rest : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/dt/type_constructor/single_test.rs:278:10
[INFO] [stdout]     |
[INFO] [stdout] 278 |         $( $Rest : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/dt/type_constructor/single_test.rs:380:10
[INFO] [stdout]     |
[INFO] [stdout] 380 |         $( $Rest : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/dt/type_constructor/pair_test.rs:187:10
[INFO] [stdout]     |
[INFO] [stdout] 187 |         $( $Rest : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/dt/type_constructor/homo_pair_test.rs:170:10
[INFO] [stdout]     |
[INFO] [stdout] 170 |         $( $Rest : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/dt/type_constructor/homo_pair_test.rs:380:10
[INFO] [stdout]     |
[INFO] [stdout] 380 |         $( $Rest : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/dt/type_constructor/homo_pair_test.rs:556:10
[INFO] [stdout]     |
[INFO] [stdout] 556 |         $( $Rest : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]   --> rust/test/meta/./meta/for_each_test.rs:17:10
[INFO] [stdout]    |
[INFO] [stdout] 17 |         $( $Arg : tt )*
[INFO] [stdout]    |          ^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/meta/./impls_index/impls1_test.rs:100:16
[INFO] [stdout]     |
[INFO] [stdout] 100 |             ( $( $Arg : tt )* ) => { };
[INFO] [stdout]     |                ^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> rust/test/meta/./impls_index/impls2_test.rs:100:16
[INFO] [stdout]     |
[INFO] [stdout] 100 |             ( $( $Arg : tt )* ) => { };
[INFO] [stdout]     |                ^^^^^^^^^^^^^
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> tests/inc/single/single_parametrized_test.rs:189:10
[INFO] [stdout]     |
[INFO] [stdout] 189 |         $( $Rest : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> tests/inc/single/single_parametrized_test.rs:276:10
[INFO] [stdout]     |
[INFO] [stdout] 276 |         $( $Rest : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]   --> tests/inc/pair/./pair_parametrized_main_test_only.rs:13:10
[INFO] [stdout]    |
[INFO] [stdout] 13 |         $( $Rest : tt )*
[INFO] [stdout]    |          ^^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]   --> tests/inc/pair/./homo_pair_parametrized_main_test_only.rs:20:10
[INFO] [stdout]    |
[INFO] [stdout] 20 |         $( $Rest : tt )*
[INFO] [stdout]    |          ^^^^^^^^^^^^^^
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
[INFO] [stdout]    --> tests/inc/many/many_parameter_test.rs:125:10
[INFO] [stdout]     |
[INFO] [stdout] 125 |         $( $Rest : tt )*
[INFO] [stdout]     |          ^^^^^^^^^^^^^^

Version it worked on

It most recently worked on: 1.86.0

Version with regression

rustc 1.87.0-beta.5 (386abeb93 2025-04-19) in crater #139827.

@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged

@cuviper cuviper added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Apr 23, 2025
@cuviper cuviper added this to the 1.87.0 milestone Apr 23, 2025
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. regression-from-stable-to-beta Performance or correctness regression from stable to beta. and removed regression-untriaged Untriaged performance or correctness regression. labels Apr 23, 2025
@fmease fmease added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-decl-macros-1-2 Area: Declarative macros 1.2 E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 23, 2025
@jieyouxu
Copy link
Member

searched nightlies: from nightly-2025-02-15 to nightly-2025-04-24
regressed nightly: nightly-2025-03-13
searched commit range: 6650252...249cb84
regressed commit: aaa2d47

bisected with cargo-bisect-rustc v0.6.9

Host triple: aarch64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --regress=error -- test -- --skip=macro_tools_test::for_each

@jieyouxu jieyouxu added S-has-bisection Status: A bisection has been found for this issue and removed E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc labels Apr 24, 2025
@jieyouxu
Copy link
Member

jieyouxu commented Apr 24, 2025

For me locally math_adapter@0.3.8 already doesn't pass all tests on stable (cloned Wandalen/wTools@9ae6281) because...

thread 'macro_tools_test::for_each' panicked at module/rust/math_adapter/rust/test/math/adapter/macro_tools_test.rs:918:1:
assertion failed: `(left == right)`

Diff < left / right > :
<std::collections::HashMap+std::collections::BTreeMap+
>std :: collections :: HashMap+std :: collections :: BTreeMap+

@jieyouxu
Copy link
Member

jieyouxu commented Apr 24, 2025

Bisects to #138083 cc @nnethercote 🤔 Should we also include compat relnotes for #138083?

Initially I thought it was also #137517, but this instead bisects to #138083.

@jieyouxu
Copy link
Member

jieyouxu commented Apr 24, 2025

EDIT: ah, I see, this is discussed in crater run analysis for #124141. Might be considered "accepted breakage" but Nicholas might want to double-check.

@moxian
Copy link
Contributor

moxian commented Apr 29, 2025

from the hackmd in the above comment, the mcve looks like:

// Produces a macro `produce_item` that, when called, produces `$item`.
macro_rules! tests_impls {
    ($item: item) => {
        macro_rules! produce_item {
            () => { $item };
        }
    };
}

// Produce a macro `produce_item` that, when called, produces a macro `_m`.
tests_impls! {
    macro_rules! _m {
        ($( $arg:tt )*) => { $( $arg )* };
    }
}

produce_item!();

@rustbot label: -E-needs-mcve +S-has-mcve

@rustbot rustbot added S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue and removed E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Apr 29, 2025
@apiraino
Copy link
Contributor

Assigning priority (discussion on Zulip), until we don't have a feedback about this being an accepted breaking change.

@rustbot label -I-prioritize +P-high

@rustbot rustbot added P-high High priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 29, 2025
@wesleywiser
Copy link
Member

Closing as intended change in behavior per @jieyouxu's comment. Relnote is in #140241.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-decl-macros-1-2 Area: Declarative macros 1.2 A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug. P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. S-has-bisection Status: A bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants