Skip to content

regression: no rules expected the token : #113236

New issue

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

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

Already on GitHub? Sign in to your account

Closed
Mark-Simulacrum opened this issue Jul 1, 2023 · 3 comments
Closed

regression: no rules expected the token : #113236

Mark-Simulacrum opened this issue Jul 1, 2023 · 3 comments
Labels
regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@Mark-Simulacrum
Copy link
Member

[INFO] [stdout] error: no rules expected the token `:`
[INFO] [stdout]   --> src/main.rs:6:57
[INFO] [stdout]    |
[INFO] [stdout] 6  |             const MEM_SIZE: usize = count_expr!($($inits:expr),+);
[INFO] [stdout]    |                                                         ^ no rules expected this token in macro call
[INFO] [stdout] ...
[INFO] [stdout] 70 | macro_rules! count_expr {
[INFO] [stdout]    | ----------------------- when calling this macro
[INFO] [stdout] ...
[INFO] [stdout] 77 |     let fib = recurrence![a[n]: u64 = 0, 1; a[n-1] + a[n-2]];
[INFO] [stdout]    |               ---------------------------------------------- in this macro invocation
[INFO] [stdout]    |
[INFO] [stdout] note: while trying to match meta-variable `$e:expr`
[INFO] [stdout]   --> src/main.rs:72:6
[INFO] [stdout]    |
[INFO] [stdout] 72 |     ($e:expr) => (1);
[INFO] [stdout]    |      ^^^^^^^
[INFO] [stdout]    = note: this error originates in the macro `recurrence` (in Nightly builds, run with -Z macro-backtrace for more info)
@Mark-Simulacrum Mark-Simulacrum added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Jul 1, 2023
@Mark-Simulacrum Mark-Simulacrum added this to the 1.71.0 milestone Jul 1, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jul 1, 2023
@Noratrieb
Copy link
Member

They messed up their macro and are accidentally passing a type ascription to the count_expr macro. Looks like the type ascription is deleted before it could be feature gated (looks like type ascription was using the old style compat-hazard feature gating?). There's nothing to do here, this should have never compiled on stable.
The easy fix is

- [INFO] [stdout] 6  |             const MEM_SIZE: usize = count_expr!($($inits:expr),+);
+ [INFO] [stdout] 6  |             const MEM_SIZE: usize = count_expr!($($inits),+);

@Noratrieb
Copy link
Member

Noratrieb commented Jul 1, 2023

preftool-dirs looks abandoned and the repo link is dead, it has very few downloads. practical-rust-macro looks like a learning repository (that also hits semicolon_in_expressions_from_macros :D), so nothing important.

Just the usual macro+features=compat-hazard stuff.

@Noratrieb Noratrieb removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jul 1, 2023
@Mark-Simulacrum Mark-Simulacrum added regression-from-stable-to-stable Performance or correctness regression from one stable version to another. and removed regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Aug 18, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Aug 18, 2023
@apiraino
Copy link
Contributor

can we perhaps close this one? cc @Mark-Simulacrum (ref. previous comments)

@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-stable Performance or correctness regression from one stable version to another. 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

4 participants