Closed as duplicate
Closed as duplicate
Description
I tried this code:
[dependencies]
assert-cmp = "0.2.1"
fn main() {
assert_cmp::assert_op!(0 < 1);
}
I expected to see this happen: Compile successfully
Instead, this happened: Error
error: expected one of `!`, `.`, `;`, `?`, `{`, `}`, or an operator, found `::`
--> src/main.rs:2:5
|
2 | assert_cmp::assert_op!(0 < 1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected one of 7 possible tokens
|
= note: this error originates in the macro `assert_cmp::assert_op` (in Nightly builds, run with -Z macro-backtrace for more info)
Meta
rustc --version --verbose
:
rustc 1.87.0 (17067e9ac 2025-05-09)
binary: rustc
commit-hash: 17067e9ac6d7ecb70e50f92c1944e545188d2359
commit-date: 2025-05-09
host: x86_64-unknown-linux-gnu
release: 1.87.0
LLVM version: 20.1.1
Backtrace
error: expected one of `!`, `.`, `;`, `?`, `{`, `}`, or an operator, found `::`
--> src/main.rs:2:5
|
2 | assert_cmp::assert_op!(0 < 1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected one of 7 possible tokens
|
= note: this error originates in the macro `assert_cmp::assert_op` (in Nightly builds, run with -Z macro-backtrace for more info)
error: could not compile `debug-assert-op` (bin "debug-assert-op") due to 1 previous error