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
The reproduction consists of an attribute macro which simply parses and tokenizes it's input. The attribute must be attached to modules. Each 'test-suite' is guarded by a feature flag.
The reproduction demonstrates the following:
In test cases 1 (one_two) and 4 (four_two) parsing an ItemMod fails because inner sugared documentation is present before another inner attribute. The compiler allows inner sugared docs to be placed before any other inner attribute, so this is an issue.
The workaround is to place the inner sugar documentation after all inner attributes.
Inner sugar docs lose their attachment. This can be observed in test cases 1 (one_one), 4 (four_one).
Also after fixing test case one_two, four_two by moving the inner sugar doc below other inner attributes.
After parsing the module and tokenizing again the sugar doc is wrongly converted into a doc-attribute. This attribute is missing it's bang-token so it becomes attached to the next syntax item.
See below
As mentioned in issue Remove Attribute::is_sugared_doc #389, documentation that is parsed by syn contains the triple slashes '/' before it's content. The image above also demonstrates this.
The text was updated successfully, but these errors were encountered:
I believe all of these bugs have been fixed as of rustc 1.27.0-nightly (48fa6f963 2018-04-05) and proc-macro2 0.3.5. Let me know if anything still seems incorrect!
I built a reproduction here: https://github.com/Bert-Proesmans/syn-issue
The reproduction consists of an attribute macro which simply parses and tokenizes it's input. The attribute must be attached to modules. Each 'test-suite' is guarded by a feature flag.
The reproduction demonstrates the following:
In test cases 1 (one_two) and 4 (four_two) parsing an ItemMod fails because inner sugared documentation is present before another inner attribute. The compiler allows inner sugared docs to be placed before any other inner attribute, so this is an issue.
The workaround is to place the inner sugar documentation after all inner attributes.
Inner sugar docs lose their attachment. This can be observed in test cases 1 (one_one), 4 (four_one).

Also after fixing test case one_two, four_two by moving the inner sugar doc below other inner attributes.
After parsing the module and tokenizing again the sugar doc is wrongly converted into a doc-attribute. This attribute is missing it's bang-token so it becomes attached to the next syntax item.
See below
As mentioned in issue Remove Attribute::is_sugared_doc #389, documentation that is parsed by syn contains the triple slashes '/' before it's content. The image above also demonstrates this.
The text was updated successfully, but these errors were encountered: