Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent "indexed-ness" for columns when using within and outside a proc-macro environment #326

Open
samuelpilz opened this issue Apr 21, 2022 · 3 comments

Comments

@samuelpilz
Copy link

samuelpilz commented Apr 21, 2022

This crates docs for LineColumn say that the column is 0-indexed. The docs for proc_macro::LineColumn say that the column is 1-indexed. As far as I can see, this is a documentation issue in proc_macro2 and the column value from the proc_macro::LineColumn is used without offset.

@samuelpilz samuelpilz changed the title off-by-one in the docs for LineColumn off-by-one error in the docs for LineColumn Apr 21, 2022
@samuelpilz
Copy link
Author

Looking at the tests, when using the parse::<TokenStream> method outside a proc-macro environment, the column seems to be 0-indexed. PR #372 shows that they are 1-indexed in a proc-macro environment.

@samuelpilz samuelpilz changed the title off-by-one error in the docs for LineColumn Inconsistent "indexed-ness" for columns when using within and outside a proc-macro environment Mar 25, 2023
@dtolnay
Copy link
Owner

dtolnay commented Mar 25, 2023

Yeah it seems this got changed in libproc_macro in rust-lang/rust#87712.

@samuelpilz
Copy link
Author

can I help fixing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants