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
I have no idea how the attribute grammar should look like. Is it still key-value pairs, or have we gone full token-trees? The letter would be unfortunate: token trees means zero support from IDEs: no extend selection for cases like #[foo= 1 + 2 + 3], because we don't know that 1 + 2 + 3 is an exression.
The answer is that an attribute can contain arbitrary token trees (though that's behind a feature flag right now). That being said, most attributes take the form of a "Meta". (e.g. in syn: https://docs.rs/syn/0.12.3/syn/enum.Meta.html). I imagine that we could add support, like in syn, a mechanism for interpreting the token trees as an Option<Meta>. IDEs could then take advantage of meta-like attributes to provide good support.
Great! Is there any RFC for this? I know about RFC for meta(and this is what currently suppported here) but token trees in the source code were a surprise for me.
Pinning down structure of attributes to meta is very useful, because you actually can show syntax errors...
Activity
mystor commentedon Jan 11, 2018
The answer is that an attribute can contain arbitrary token trees (though that's behind a feature flag right now). That being said, most attributes take the form of a "Meta". (e.g. in syn: https://docs.rs/syn/0.12.3/syn/enum.Meta.html). I imagine that we could add support, like in
syn, a mechanism for interpreting the token trees as anOption<Meta>. IDEs could then take advantage of meta-like attributes to provide good support.matklad commentedon Jan 11, 2018
Great! Is there any RFC for this? I know about RFC for meta(and this is what currently suppported here) but token trees in the source code were a surprise for me.
Pinning down structure of attributes to meta is very useful, because you actually can show syntax errors...
mystor commentedon Jan 11, 2018
It's part of the procedural macros work. See rust-lang/rust#40346 for the commentary on the PR to rustc.
matklad commentedon Jan 11, 2018
Excellent, thanks a lot @mystor for this and for other comments as well, they are really helpful! ❤️
Merge pull request rust-lang#8 from waywardmonkeys/test-without-serde
Auto merge of #118488 - andjo403:remove_deadlock, r=SparrowLii
Auto merge of #118488 - andjo403:remove_deadlock, r=SparrowLii
Auto merge of #131460 - jwong101:default-placement-new, r=ibraheemdev
Allow pipes in parameters
Merge rust-lang#8