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

Emit an error when rustc_doc_primitive has an unknown value #123584

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Apr 7, 2024

Currently rustdoc silently does nothing. Change this to raise an error instead.

@rustbot
Copy link
Collaborator

rustbot commented Apr 7, 2024

r? @fmease

rustbot has assigned @fmease.
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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 7, 2024
@rustbot
Copy link
Collaborator

rustbot commented Apr 7, 2024

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

@tgross35
Copy link
Contributor Author

tgross35 commented Apr 7, 2024

rustbot has assigned @fmease.

Right choice again 😄

@tgross35 tgross35 force-pushed the rustc_doc_primitive-usage-error branch 2 times, most recently from 62bc421 to 263262c Compare April 7, 2024 07:09
Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

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

Attribute validation usually happens way earlier in the pipeline, e.g., in rustc_ast_passes or rustc_passes for several reasons but given PrimitiveType is defined in rustdoc, this location makes sense. The error won't trigger on rustc invocations but hey, this error is meant for contributors only.

I have one nitpick, namely turning the struct_span_err into a span_bug!.
The latter is meant for contributors which is the case here. Note that that's fine because we are allowed to ICE under rustc_attrs (or under any internal feature for that matter).

struct_span_err is meant to get removed at some point to be fully replaced with the translatable diagnostic APIs -- and we definitely don't want to make this error translatable.

@fmease
Copy link
Member

fmease commented Apr 7, 2024

r=me with struct_span_err turned into a span_bug! and with the test removed (I don't think it's worth keeping it & normalizing its stderr).

@bors delegate+

@bors
Copy link
Contributor

bors commented Apr 7, 2024

✌️ @tgross35, you can now approve this pull request!

If @fmease told you to "r=me" after making some further change, please make that change, then do @bors r=@fmease

@fmease
Copy link
Member

fmease commented Apr 7, 2024

@bors rollup

Currently rustdoc silently does nothing if it isn't aware of the
specified primitive type. Change this to raise an error instead.
@tgross35 tgross35 force-pushed the rustc_doc_primitive-usage-error branch from 263262c to 695514e Compare April 7, 2024 07:21
@tgross35
Copy link
Contributor Author

tgross35 commented Apr 7, 2024

Even easier, thanks for the quick review!

@bors r=fmease rollup

@bors
Copy link
Contributor

bors commented Apr 7, 2024

📌 Commit 695514e has been approved by fmease

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

Rollup of 2 pull requests

Successful merges:

 - rust-lang#123584 (Emit an error when `rustc_doc_primitive` has an unknown value)
 - rust-lang#123589 (sys_common::thread_local_key: make a note that this is not used on Windows)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f64e971 into rust-lang:master Apr 7, 2024
11 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 7, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 7, 2024
Rollup merge of rust-lang#123584 - tgross35:rustc_doc_primitive-usage-error, r=fmease

Emit an error when `rustc_doc_primitive` has an unknown value

Currently rustdoc silently does nothing. Change this to raise an error instead.
@tgross35 tgross35 deleted the rustc_doc_primitive-usage-error branch April 7, 2024 16:57
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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants