Skip to content

Proc macro spans: make columns 1 based #87712

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

Merged
merged 3 commits into from
Aug 4, 2021

Conversation

est31
Copy link
Member

@est31 est31 commented Aug 3, 2021

This makes proc macro spans consistent with the column!() macro as well as std::panic::Location, as both are 1-based.

#54725 (comment)

@rust-highfive
Copy link
Contributor

r? @petrochenkov

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 3, 2021
@est31 est31 force-pushed the line-column-1-based branch from 68e55f3 to a6f989f Compare August 3, 2021 00:58
@est31
Copy link
Member Author

est31 commented Aug 3, 2021

Note that there are still small differences between proc macro span columns and panic location columns: the panic location counts a tab as 4 characters while the proc macro spans count it as 1 character. However, the column!() macro does this as well so I don't think it's a problem that needs solving.

@rust-log-analyzer

This comment has been minimized.

@est31 est31 force-pushed the line-column-1-based branch from a6f989f to 7d20789 Compare August 3, 2021 01:33
@petrochenkov
Copy link
Contributor

This looks reasonable and the API is (perpetually?) unstable, so I'm going to just r+ this.
@bors r+

@bors
Copy link
Collaborator

bors commented Aug 3, 2021

📌 Commit 7d20789 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 3, 2021
@bors
Copy link
Collaborator

bors commented Aug 4, 2021

⌛ Testing commit 7d20789 with merge 71ff9b4...

@bors
Copy link
Collaborator

bors commented Aug 4, 2021

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing 71ff9b4 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 4, 2021
@bors bors merged commit 71ff9b4 into rust-lang:master Aug 4, 2021
@rustbot rustbot added this to the 1.56.0 milestone Aug 4, 2021
@dtolnay dtolnay added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Mar 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants