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
Hi,
my code failed when executing seq test case 03, the output is:
ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: error number 0
--> tests/03-expand-four-errors.rs:19:1
|
19 | / seq!(N in 0..4 {
20 | | compile_error!(concat!("error number ", stringify!(N)));
21 | | });
| |__^
|
= note: this error originates in the macro `seq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: error number 1
--> tests/03-expand-four-errors.rs:19:1
|
19 | / seq!(N in 0..4 {
20 | | compile_error!(concat!("error number ", stringify!(N)));
21 | | });
| |__^
|
= note: this error originates in the macro `seq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: error number 2
--> tests/03-expand-four-errors.rs:19:1
|
19 | / seq!(N in 0..4 {
20 | | compile_error!(concat!("error number ", stringify!(N)));
21 | | });
| |__^
|
= note: this error originates in the macro `seq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: error number 3
--> tests/03-expand-four-errors.rs:19:1
|
19 | / seq!(N in 0..4 {
20 | | compile_error!(concat!("error number ", stringify!(N)));
21 | | });
| |__^
|
= note: this error originates in the macro `seq` (in Nightly builds, run with -Z macro-backtrace for more info)
I even tried to print the result TokenStream before returning and it looks totally correct (begin with "compile_error" as ident). Download someone else's code from github and test, same output...
rust version: 1.75.0
dependencies:
proc-macro2 = "1.0.81"
syn = { version = "2.0.59", features = ["full", "extra-traits"] }
quote = "1.0.36"
prettyplease = "0.2.1"
This passes in the reference implementation, so it is definitely possible to implement as shown.
If you take this question to any of the resources shown in https://www.rust-lang.org/community, plenty of people have experience writing macros and should be able to help you sort it out.
Hi,
my code failed when executing seq test case 03, the output is:
I even tried to print the result TokenStream before returning and it looks totally correct (begin with "compile_error" as ident).
Download someone else's code from github and test, same output...
rust version: 1.75.0
dependencies:
repository: https://github.com/apodemakeles/proc-macro-workshop/blob/seq/seq/src/lib.rs
The text was updated successfully, but these errors were encountered: