You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unlike rustc, RA macro expansion adds parentheses around negative numbers like -42.0:
test_macro!(T2, -42.0);
expands to
constT2:&str = concat!((-42.0));;
which produces diagnostic: expected a literal: only literals can be passed to concat!().
NOTE: even if RA did not add the parenthesis, there would still be a problem with concat!(-42.0). But that seem to be separate issue, which I filed here: #19417
Below code compiles fine with rustc, but produces error diagnostic with RA.
Unlike rustc, RA macro expansion adds parentheses around negative numbers like
-42.0
:expands to
which produces diagnostic:
expected a literal: only literals can be passed to concat!()
.NOTE: even if RA did not add the parenthesis, there would still be a problem with
concat!(-42.0)
. But that seem to be separate issue, which I filed here: #19417rust-analyzer version: 1.87.0-nightly (be73c1f 2025-03-21)
rustc version: rustc 1.87.0-nightly (be73c1f46 2025-03-21)
The text was updated successfully, but these errors were encountered: