Skip to content

Conversation

@Enselic
Copy link
Member

@Enselic Enselic commented Dec 20, 2025

Start small. If it works well we can increase usage bit by bit as time passes.

My main motivation for doing this is to get rid of the + 1 I otherwise have to add in #150201 on this line:

                crate::directives::line::line_directive(file, zero_based_line_no + 1, &line)

But I think this is a nice general improvement by itself.

Note that we keep using "0" to represent "no specific line" because changing to Option<LineNumber> everywhere is a very noisy and significant change. That can be changed later if wanted, but let's not do it now.

@rustbot
Copy link
Collaborator

rustbot commented Dec 20, 2025

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Dec 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 20, 2025

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@Enselic Enselic marked this pull request as draft December 20, 2025 18:21
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 20, 2025
@rust-log-analyzer

This comment has been minimized.

@Enselic Enselic force-pushed the line-no branch 2 times, most recently from 5a015a9 to 334900c Compare December 22, 2025 07:58
@Enselic Enselic changed the title compiletest: Add LineNo newtype to avoid +1 magic here and there compiletest: Add LineNumber newtype to avoid +1 magic here and there Dec 22, 2025
@rust-log-analyzer

This comment has been minimized.

Start small. If it works well we can increase usage bit by bit as time
passes.

Note that we keep using "0" to represent "no specific line" because
changing to `Option<LineNumber>` everywhere is much bigger and noisier
change. That can be done later if wanted.
@Enselic
Copy link
Member Author

Enselic commented Dec 22, 2025

I've done some additional verification and code cleanup and am happy with how this works and looks. Ready for review!

@Enselic Enselic marked this pull request as ready for review December 22, 2025 15:34
@rustbot

This comment was marked as off-topic.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants