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

collect_tokens_trailing_token cleanups #127902

Merged

Conversation

nnethercote
Copy link
Contributor

More cleanups I made while understanding the code for processing cfg_attr, to fix test failures in #124141.

r? @petrochenkov

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 18, 2024
@rust-log-analyzer

This comment has been minimized.

@nnethercote nnethercote force-pushed the collect_tokens_trailing_token-cleanups branch from 01ce3e9 to b21933e Compare July 18, 2024 09:03
@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

r=me after updating the doc example to not fail.
@rustbot author

@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 Jul 18, 2024
@bors
Copy link
Contributor

bors commented Jul 18, 2024

☔ The latest upstream changes (presumably #127906) made this pull request unmergeable. Please resolve the merge conflicts.

@nnethercote nnethercote force-pushed the collect_tokens_trailing_token-cleanups branch from b21933e to 4b20da7 Compare July 18, 2024 22:44
@nnethercote
Copy link
Contributor Author

I fixed the doc failure and rebased.

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Jul 18, 2024

📌 Commit 4b20da7 has been approved by petrochenkov

It is now in the queue for this repository.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 18, 2024
@nnethercote
Copy link
Contributor Author

@bors rollup

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 19, 2024
…g_token-cleanups, r=petrochenkov

`collect_tokens_trailing_token` cleanups

More cleanups I made while understanding the code for processing `cfg_attr`, to fix test failures in rust-lang#124141.

r? ``@petrochenkov``
@tgross35
Copy link
Contributor

@nnethercote I guess you have to rebase again and update the ```ignore test in attr_wrapper, tidy is complaining about it here https://github.com/rust-lang/rust/actions/runs/10002645597/job/27648285238?pr=127952#step:25:1689.

No clue why that didn't show up in PR CI, #127936 is the only thing that merged since you rebased.

@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 19, 2024
The `Option`s within the `ReplaceRange`s within the hashmap are always
`None`. This PR omits them and inserts them when they are extracted from
the hashmap.
It's no shorter than `ret.attrs()`, and `ret.attrs()` is used multiple
times earlier in the function.
This puts it just before the `replace_ranges` initialization, which
makes sense because the two variables are closely related.
Currently in `collect_tokens_trailing_token`, `start_pos` and `end_pos`
are 1-indexed by `replace_ranges` is 0-indexed, which is really
confusing. Making them both 0-indexed makes debugging much easier.
Adding details, clarifying lots of little things, etc. In particular,
the commit adds details of an example. I find this very helpful, because
it's taken me a long time to understand how this code works.
@nnethercote nnethercote force-pushed the collect_tokens_trailing_token-cleanups branch from 4b20da7 to 1dd566a Compare July 19, 2024 05:49
@nnethercote
Copy link
Contributor Author

I added a reason to the ignore comment, hopefully that should fix the problem.

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Jul 19, 2024

📌 Commit 1dd566a has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 19, 2024
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 19, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 19, 2024
Rollup of 7 pull requests

Successful merges:

 - rust-lang#121533 (Handle .init_array link_section specially on wasm)
 - rust-lang#127825 (Migrate `macos-fat-archive`, `manual-link` and `archive-duplicate-names` `run-make` tests to rmake)
 - rust-lang#127891 (Tweak suggestions when using incorrect type of enum literal)
 - rust-lang#127902 (`collect_tokens_trailing_token` cleanups)
 - rust-lang#127928 (Migrate `lto-smoke-c` and `link-path-order` `run-make` tests to rmake)
 - rust-lang#127935 (Change `binary_asm_labels` to only fire on x86 and x86_64)
 - rust-lang#127953 ([compiletest] Search *.a when getting dynamic libraries on AIX)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4155742 into rust-lang:master Jul 19, 2024
6 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 19, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 19, 2024
Rollup merge of rust-lang#127902 - nnethercote:collect_tokens_trailing_token-cleanups, r=petrochenkov

`collect_tokens_trailing_token` cleanups

More cleanups I made while understanding the code for processing `cfg_attr`, to fix test failures in rust-lang#124141.

r? `@petrochenkov`
@nnethercote nnethercote deleted the collect_tokens_trailing_token-cleanups branch July 21, 2024 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants