Skip to content

Use backticks instead of single quotes for library feature names in diagnostics #132544

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

dianne
Copy link
Contributor

@dianne dianne commented Nov 2, 2024

This PR changes the text of library feature errors for using unstable or body-unstable items. Displaying library feature names in backticks is consistent with other diagnostics (e.g. those from rustc_passes) and with the reasons on unstable attributes in the library. Additionally, this simplifies diagnostics when supporting multiple unstable attributes on items (see #131824) since DiagSymbolList also displays symbols using backticks.

@rustbot
Copy link
Collaborator

rustbot commented Nov 2, 2024

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
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

@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 Nov 2, 2024
@rust-log-analyzer

This comment has been minimized.

@dianne dianne force-pushed the unstable-library-feature-backticks branch from 0984864 to f3c53ac Compare November 3, 2024 00:13
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a somewhat churny change, but i also agree with it, so whatever 😅

@compiler-errors
Copy link
Member

r? compiler-errors @bors r+ rollup

@bors
Copy link
Collaborator

bors commented Nov 3, 2024

📌 Commit f3c53ac 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 Nov 3, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 3, 2024
…ckticks, r=compiler-errors

Use backticks instead of single quotes for library feature names in diagnostics

This PR changes the text of library feature errors for using unstable or body-unstable items. Displaying library feature names in backticks is consistent with other diagnostics (e.g. those from `rustc_passes`) and with the `reason`s on unstable attributes in the library. Additionally, this simplifies diagnostics when supporting multiple unstable attributes on items (see rust-lang#131824) since `DiagSymbolList` also displays symbols using backticks.
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 3, 2024
…iaskrgr

Rollup of 16 pull requests

Successful merges:

 - rust-lang#129329 (Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`)
 - rust-lang#131377 (Add LowerExp and UpperExp implementations to NonZero)
 - rust-lang#132393 (Docs: added brief colon explanation)
 - rust-lang#132437 (coverage: Regression test for inlining into an uninstrumented crate)
 - rust-lang#132499 (unicode_data.rs: show command for generating file)
 - rust-lang#132503 (better test for const HashMap; remove const_hash leftovers)
 - rust-lang#132511 (stabilize const_arguments_as_str)
 - rust-lang#132520 (NFC add known bug nr to test)
 - rust-lang#132522 (make codegen help output more consistent)
 - rust-lang#132523 (Added regression test for generics index out of bounds)
 - rust-lang#132528 (Use `*_opt` typeck results fns to not ICE in fallback suggestion)
 - rust-lang#132537 (PassWrapper: adapt for llvm/llvm-project@5445edb5d)
 - rust-lang#132540 (Do not format generic consts)
 - rust-lang#132543 (add and update some crashtests)
 - rust-lang#132544 (Use backticks instead of single quotes for library feature names in diagnostics)
 - rust-lang#132550 (compiler: Continue introducing rustc_abi to the compiler)

r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr
Copy link
Member

@bors r-
#132554 (comment)

@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 Nov 3, 2024
…e library feature"

This is consistent with all other diagnostics I could find containing
features and enables the use of `DiagSymbolList` for generalizing
diagnostics for unstable library features to multiple features.
This commit can be reverted once the error message changes are in the stage 0 compiler.
@dianne dianne force-pushed the unstable-library-feature-backticks branch from f3c53ac to ae42814 Compare November 3, 2024 22:33
@dianne
Copy link
Contributor Author

dianne commented Nov 3, 2024

@rustbot ready

I think the 2nd commit should fix that merge failure, but let me know if there's a better way to get --stage 1 ui-fulldeps to pass.

@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 Nov 3, 2024
@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 4, 2024

📌 Commit ae42814 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 Nov 4, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 4, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#132355 (Fix compiler panic with a large number of threads)
 - rust-lang#132486 (No need to instantiate binder in `confirm_async_closure_candidate`)
 - rust-lang#132544 (Use backticks instead of single quotes for library feature names in diagnostics)
 - rust-lang#132559 (find the generic container rather than simply looking up for the assoc with const arg)
 - rust-lang#132579 (add rustc std workspace crate sources)
 - rust-lang#132583 (Suggest creating unary tuples when types don't match a trait)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b9db639 into rust-lang:master Nov 4, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 4, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 4, 2024
Rollup merge of rust-lang#132544 - dianne:unstable-library-feature-backticks, r=compiler-errors

Use backticks instead of single quotes for library feature names in diagnostics

This PR changes the text of library feature errors for using unstable or body-unstable items. Displaying library feature names in backticks is consistent with other diagnostics (e.g. those from `rustc_passes`) and with the `reason`s on unstable attributes in the library. Additionally, this simplifies diagnostics when supporting multiple unstable attributes on items (see rust-lang#131824) since `DiagSymbolList` also displays symbols using backticks.
@dianne dianne deleted the unstable-library-feature-backticks branch November 5, 2024 02:02
# for free to join this conversation on GitHub. Already have an account? # 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.

7 participants