Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Should MacroCall remove visibility? #52

Open
ehuss opened this issue Jun 28, 2019 · 1 comment
Open

Should MacroCall remove visibility? #52

ehuss opened this issue Jun 28, 2019 · 1 comment
Labels
grammar Issues with the definition of the rust grammar restrictions Issues related to the permissiveness of the grammar

Comments

@ehuss
Copy link
Contributor

ehuss commented Jun 28, 2019

Currently libsyntax rejects any visibility modifier on a macro invocation in ItemKind, ImplItemKind, and ForeignItemKind.

@ehuss ehuss added the grammar Issues with the definition of the rust grammar label Jun 28, 2019
@petrochenkov
Copy link

petrochenkov commented Jun 28, 2019

That's correct behavior, I think.

The only similar case where macro call (foo!()) is not a whole item/statement is semicolon foo!(); and we already have issues with expanding macros with a semicolon in the token model (rust-lang/rust#61733).
Semicolon problems are reasonably solvable though, but what should be done with a pub attached to a macro invocation is not clear at all.

(Oh, also attributes #[attr] foo! { ... }, which also lead to confusing behavior incompatible with the token model if the attribute is inert.)

@eddyb eddyb added restrictions Issues related to the permissiveness of the grammar and removed restrictions Issues related to the permissiveness of the grammar labels Jul 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
grammar Issues with the definition of the rust grammar restrictions Issues related to the permissiveness of the grammar
Projects
None yet
Development

No branches or pull requests

3 participants