]> git.lizzy.rs Git - rust.git/commit
proc_macro: Preserve spans of attributes on functions
authorAlex Crichton <alex@alexcrichton.com>
Thu, 19 Jul 2018 14:06:31 +0000 (07:06 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 19 Jul 2018 14:06:44 +0000 (07:06 -0700)
commit53323751a9caaf678689e0d437f79d0c169b2dae
tree712369d9688700a6f9f8139ce82e24ed9e9d0064
parent5ba21844f6c85a0cd55c8ea0250d5cd758134f84
proc_macro: Preserve spans of attributes on functions

This commit updates the tokenization of items which are subsequently passed to
`proc_macro` to ensure that span information is preserved on attributes as much
as possible. Previously this area of the code suffered from #43081 where we
haven't actually implemented converting an attribute to to a token tree yet, but
a local fix was possible here.

Closes #47941
src/libsyntax/parse/token.rs
src/test/ui-fulldeps/proc-macro/attribute-spans-preserved.rs [new file with mode: 0644]
src/test/ui-fulldeps/proc-macro/attribute-spans-preserved.stderr [new file with mode: 0644]
src/test/ui-fulldeps/proc-macro/attribute-spans-preserved.stdout [new file with mode: 0644]
src/test/ui-fulldeps/proc-macro/auxiliary/attribute-spans-preserved.rs [new file with mode: 0644]