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
{{ message }}
This repository has been archived by the owner on Oct 6, 2024. It is now read-only.
When I try to concatenate a minus sign (-), a float literal (e.g. 0.0), and a type suffix (e.g. f32 or f64), rustc reports errors. Here is a reproduction code:
In my actual project, I used the paste! macro with the duplicate! macro for unit tests using f32/f64 values like this:
use duplicate::duplicate;use paste::paste;duplicate!{[ float;[f32];[f64];]// In this code block, the word `float` is replaced with `f32` and `f64`.
paste! {
#[test]fn[< ulp_should_return_EPSILON_when_self_is_1_ float >](){// Here is the problematic code `[< 1.0 float >]`.
assert_eq!([< 1.0 float >].ulp(), float::EPSILON);}// Many other test functions using f32 and f64 are omitted.// ...}}
paste: 1.0.12
rustc: 1.68.2
When I try to concatenate a minus sign (
-
), a float literal (e.g.0.0
), and a type suffix (e.g.f32
orf64
), rustc reports errors. Here is a reproduction code:In my actual project, I used the
paste!
macro with theduplicate!
macro for unit tests using f32/f64 values like this:I expected the following code to be generated:
The
duplicate!
macro is not the cause of the compilation error, as shown in the reproduction code at the top of this post.Please make the
paste!
macro able to concatenate signs, floating point numbers, and type suffixes 🙏The text was updated successfully, but these errors were encountered: