-
Notifications
You must be signed in to change notification settings - Fork 14k
Emit an error when rustc_doc_primitive has an unknown value
#123584
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
Conversation
|
Some changes occurred in src/librustdoc/clean/types.rs cc @camelid |
Right choice again 😄 |
62bc421 to
263262c
Compare
There was a problem hiding this 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.
|
r=me with @bors delegate+ |
|
@bors rollup |
Currently rustdoc silently does nothing if it isn't aware of the specified primitive type. Change this to raise an error instead.
263262c to
695514e
Compare
|
Even easier, thanks for the quick review! @bors r=fmease rollup |
…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
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.
Currently rustdoc silently does nothing. Change this to raise an error instead.