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
Marwes opened this issue
Jun 30, 2018
· 0 comments
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)I-slowIssue: Problems and improvements with respect to performance of generated code.
Currently the recursion limit for monomorphization is 64 which the toml_edit crate ended up hitting as reported in Marwes/combine#172 . The solution here is to manually specify a higher recursion limit via the recursion_limit attribute.
This does mean that the attribute ends up in a bit of a weird situation though, since recursion_limit also affects macro expansions which has a default value of 1024. So any explicitly set value between 64 and 1024 actually ends up reducing the recursion limit for macros.
I assume that there is a good reason for the monomorphization limit being so low compared to the macro limit. But if that is the case then it is perhaps a bit problematic that any increase of the limit for the sake of macro expansion will actually also end up increasing it for monomorphizations as well, only it is increased by a factor of 20 or more.
...
I don't think there is anything that is actually directly actionable in this issue now that I have written it out. But I figure I should still post this as I did end up being rather confused by the fact that setting the recursion_limit to 1024 actually fixed the issue in toml_edit, despite the fact that I remember it being increased to 1024 some time ago (only when I dug up the issue did I realize it was only for macros)
The text was updated successfully, but these errors were encountered:
Marwes
changed the title
Increase the recursion limit for monomorphizations
The recursion limit for monomorphizations are different than for macro expansions
Jun 30, 2018
estebank
added
I-slow
Issue: Problems and improvements with respect to performance of generated code.
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
labels
Jul 2, 2018
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)I-slowIssue: Problems and improvements with respect to performance of generated code.
Currently the recursion limit for monomorphization is 64 which the toml_edit crate ended up hitting as reported in Marwes/combine#172 . The solution here is to manually specify a higher recursion limit via the
recursion_limit
attribute.This does mean that the attribute ends up in a bit of a weird situation though, since
recursion_limit
also affects macro expansions which has a default value of 1024. So any explicitly set value between 64 and 1024 actually ends up reducing the recursion limit for macros.I assume that there is a good reason for the monomorphization limit being so low compared to the macro limit. But if that is the case then it is perhaps a bit problematic that any increase of the limit for the sake of macro expansion will actually also end up increasing it for monomorphizations as well, only it is increased by a factor of 20 or more.
...
I don't think there is anything that is actually directly actionable in this issue now that I have written it out. But I figure I should still post this as I did end up being rather confused by the fact that setting the recursion_limit to 1024 actually fixed the issue in toml_edit, despite the fact that I remember it being increased to 1024 some time ago (only when I dug up the issue did I realize it was only for macros)
The text was updated successfully, but these errors were encountered: