-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
select! cannot contain more than 64 macro calls #2097
Comments
Presumably this is a limitation of proc-macro-hack? cc @dtolnay |
Yeah this limit comes from https://github.com/dtolnay/proc-macro-hack/blob/0.5.11/nested/build.rs#L29. I guess we could bump it. I don't know how much it would slow down rustc's macro matcher; the generated macro is quadratically large in this limit. |
If possible, at least a proper error msg should be generated. I managed to reduce the issue a bit by converting a commonly used custom macro to a regular function. |
I fixed the error message in proc-macro-nested 0.1.4. error: this macro does not support >64 nested macro invocations
--> src/main.rs:13:9
|
13 | / select! {
14 | | _ = next_msg => {
15 | | println!("1");
16 | | println!("2");
... |
80 | | }
81 | | }
| |_________^ |
This will be fixed by dtolnay/proc-macro-hack#62. (Rust 1.45+) |
This is a bit strange, but based on experimentation, I hope that the issue title is right.
The following code fails to compile:
Error message:
Removing one of the println calls makes it compile.
The problem is not specific to
println!
, it also happens with macros likedebug!
.Reproducer: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=de8c4b5aa1ae3ac9c432952e9143fb59
This happened to me in a real-world project due to logging calls in a big select block 😕
The text was updated successfully, but these errors were encountered: