Skip to content

Clean: rename open_braces to open_delimiters in lexer and move make_unclosed_delims_error into diagnostics.rs. #140147

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 2 commits into from
Apr 23, 2025

Conversation

xizheyin
Copy link
Contributor

Clean code prepared for resolving #138401. To avoid having too many extraneous changes in one PR, I cleaned up some of the naming and method placement in lexer in this PR.

  1. For the make_unclosed_delims_error function defined in mod.rs is only used in lexer, so moved into lexer, which enhances encapsulation.
  2. For open_braces in TokenTreeDiagInfo the naming is not canonical, as Brace refers to {...} and this variable can store all kinds of different Delimiters. so I named it open_delimiters.

r? @chenyukang

Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
@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 Apr 22, 2025
@compiler-errors
Copy link
Member

r? compiler-errors @bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 22, 2025

📌 Commit dce5d99 has been approved by compiler-errors

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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 22, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 23, 2025
…enton

Rollup of 7 pull requests

Successful merges:

 - rust-lang#140142 (Some more graphviz tweaks)
 - rust-lang#140146 (Update `compiler_builtins` to 0.1.156)
 - rust-lang#140147 (Clean: rename `open_braces` to `open_delimiters` in lexer and move `make_unclosed_delims_error` into `diagnostics.rs`.)
 - rust-lang#140160 (Use `is_lang_item` and `as_lang_item` instead of handrolling their logic)
 - rust-lang#140163 (Validate extension in `PathBuf::add_extension`)
 - rust-lang#140173 (Ping Mara when touching format_args!() internals.)
 - rust-lang#140175 (`rc""` more clear error message)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 23, 2025
…enton

Rollup of 7 pull requests

Successful merges:

 - rust-lang#140142 (Some more graphviz tweaks)
 - rust-lang#140146 (Update `compiler_builtins` to 0.1.156)
 - rust-lang#140147 (Clean: rename `open_braces` to `open_delimiters` in lexer and move `make_unclosed_delims_error` into `diagnostics.rs`.)
 - rust-lang#140160 (Use `is_lang_item` and `as_lang_item` instead of handrolling their logic)
 - rust-lang#140163 (Validate extension in `PathBuf::add_extension`)
 - rust-lang#140173 (Ping Mara when touching format_args!() internals.)
 - rust-lang#140175 (`rc""` more clear error message)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 23, 2025
…enton

Rollup of 7 pull requests

Successful merges:

 - rust-lang#140142 (Some more graphviz tweaks)
 - rust-lang#140146 (Update `compiler_builtins` to 0.1.156)
 - rust-lang#140147 (Clean: rename `open_braces` to `open_delimiters` in lexer and move `make_unclosed_delims_error` into `diagnostics.rs`.)
 - rust-lang#140160 (Use `is_lang_item` and `as_lang_item` instead of handrolling their logic)
 - rust-lang#140163 (Validate extension in `PathBuf::add_extension`)
 - rust-lang#140173 (Ping Mara when touching format_args!() internals.)
 - rust-lang#140175 (`rc""` more clear error message)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 23, 2025
…enton

Rollup of 7 pull requests

Successful merges:

 - rust-lang#140142 (Some more graphviz tweaks)
 - rust-lang#140146 (Update `compiler_builtins` to 0.1.156)
 - rust-lang#140147 (Clean: rename `open_braces` to `open_delimiters` in lexer and move `make_unclosed_delims_error` into `diagnostics.rs`.)
 - rust-lang#140160 (Use `is_lang_item` and `as_lang_item` instead of handrolling their logic)
 - rust-lang#140163 (Validate extension in `PathBuf::add_extension`)
 - rust-lang#140173 (Ping Mara when touching format_args!() internals.)
 - rust-lang#140175 (`rc""` more clear error message)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 090f6a9 into rust-lang:master Apr 23, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 23, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 23, 2025
Rollup merge of rust-lang#140147 - xizheyin:issue-138401-1, r=compiler-errors

Clean: rename `open_braces` to `open_delimiters` in lexer and move `make_unclosed_delims_error` into `diagnostics.rs`.

Clean code prepared for resolving rust-lang#138401. To avoid having too many extraneous changes in one PR, I cleaned up some of the naming and method placement in lexer in this PR.
1. For the make_unclosed_delims_error function defined in mod.rs is only used in lexer, so moved into lexer, which enhances encapsulation.
2. For open_braces in TokenTreeDiagInfo the naming is not canonical, as Brace refers to `{...} ` and this variable can store all kinds of different Delimiters. so I named it open_delimiters.

r? `@chenyukang`
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Apr 24, 2025
…enton

Rollup of 7 pull requests

Successful merges:

 - rust-lang#140142 (Some more graphviz tweaks)
 - rust-lang#140146 (Update `compiler_builtins` to 0.1.156)
 - rust-lang#140147 (Clean: rename `open_braces` to `open_delimiters` in lexer and move `make_unclosed_delims_error` into `diagnostics.rs`.)
 - rust-lang#140160 (Use `is_lang_item` and `as_lang_item` instead of handrolling their logic)
 - rust-lang#140163 (Validate extension in `PathBuf::add_extension`)
 - rust-lang#140173 (Ping Mara when touching format_args!() internals.)
 - rust-lang#140175 (`rc""` more clear error message)

r? `@ghost`
`@rustbot` modify labels: rollup
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.

5 participants