syn icon indicating copy to clipboard operation
syn copied to clipboard

Use Literal::subspan to produce better spans from LitStr::parse

Open dtolnay opened this issue 5 years ago • 1 comments

LitStr::parse currently puts the entire input string's span on every output token. It would be better to try producing smaller spans using Literal::subspan.

dtolnay avatar Apr 15 '19 19:04 dtolnay

I have a suspicion that TedDriggs/darling#120 is somehow related to this, but the symptoms are different.

impl FromMeta for syn::Path is using LitStr::parse here, but when testing this in colin-kiegel/rust-derive-builder#194 breaking the example by commenting out the conversion leads to the error only showing on the last quotation mark.

Is there a good way for me to test this in more detail?

TedDriggs avatar Jan 15 '21 18:01 TedDriggs