Skip to content

regression: error: expected one of !, ., ;, ?, {, }, or an operator, found :: #140223

Closed as not planned
@cuviper

Description

@cuviper
[INFO] [stdout] error: expected one of `!`, `.`, `;`, `?`, `{`, `}`, or an operator, found `::`
[INFO] [stdout]  --> test.rs:8:5
[INFO] [stdout]   |
[INFO] [stdout] 8 |     ::assert_cmp::assert_op!(123 < 456);
[INFO] [stdout]   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected one of 7 possible tokens
[INFO] [stdout]   |
[INFO] [stdout]   = note: this error originates in the macro `::assert_cmp::assert_op` (in Nightly builds, run with -Z macro-backtrace for more info)

(and many more of the same)

With the suggested macro-backtrace, that particular instance reports:

error: expected one of `!`, `.`, `;`, `?`, `{`, `}`, or an operator, found `::`
  --> [...]/assert-cmp/lib.rs:48:24
   |
37 | /         macro_rules! $name_simple {
38 | |             ($left:ident $op:tt $right:ident) => {
39 | |                 $module::$name_expr!($left, $op, $right)
40 | |             };
...  |
48 | |                 $module::$name_expr!($left, $op, $right)
   | |                        ^^ expected one of 7 possible tokens
49 | |             };
50 | |         }
   | |_________- in this expansion of `::assert_cmp::assert_op!`
   |
  ::: test.rs:8:5
   |
8  |       ::assert_cmp::assert_op!(123 < 456);
   |       ----------------------------------- in this macro invocation

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-decl-macros-1-2Area: Declarative macros 1.2A-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 issueregression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions