Skip to content

Commit 8d19877

Browse files
committed
Auto merge of #41791 - Mark-Simulacrum:doc-guidelines, r=frewsxcv
Minor cleanup of UX guidelines. I think this fixes #34808. It covers the [long error code explanations normalization] by linking to the RFC, and cleaning up the list where long diagnostics are defined. While the [error message overhaul] isn't covered directly, I'm not really sure that more than the [existing section] on the error/warning/help messages is warranted; the overhaul linked didn't really specify any new guidelines, primarily just changing the output format. [Long error code explanations normalization]: https://github.com/rust-lang/rfcs/blob/master/text/1567-long-error-codes-explanation-normalization.md [Error message overhaul]: #33240 [existing section]: https://github.com/rust-lang/rust/blob/master/src/doc/rustc-ux-guidelines.md#error-warning-help-note-messages
2 parents a478e46 + 7f2f780 commit 8d19877

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/doc/rustc-ux-guidelines.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,22 @@ Error explanations are long form descriptions of error messages provided with
5656
the compiler. They are accessible via the `--explain` flag. Each explanation
5757
comes with an example of how to trigger it and advice on how to fix it.
5858

59+
Please read [RFC 1567](https://github.com/rust-lang/rfcs/blob/master/text/1567-long-error-codes-explanation-normalization.md)
60+
for details on how to format and write long error codes.
61+
5962
* All of them are accessible [online](http://doc.rust-lang.org/error-index.html),
6063
which are auto-generated from rustc source code in different places:
6164
[librustc](https://github.com/rust-lang/rust/blob/master/src/librustc/diagnostics.rs),
65+
[libsyntax](https://github.com/rust-lang/rust/blob/master/src/libsyntax/diagnostics.rs),
6266
[librustc_borrowck](https://github.com/rust-lang/rust/blob/master/src/librustc_borrowck/diagnostics.rs),
6367
[librustc_const_eval](https://github.com/rust-lang/rust/blob/master/src/librustc_const_eval/diagnostics.rs),
64-
[librustc_lint](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/types.rs),
6568
[librustc_metadata](https://github.com/rust-lang/rust/blob/master/src/librustc_metadata/diagnostics.rs),
6669
[librustc_mir](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/diagnostics.rs),
6770
[librustc_passes](https://github.com/rust-lang/rust/blob/master/src/librustc_passes/diagnostics.rs),
6871
[librustc_privacy](https://github.com/rust-lang/rust/blob/master/src/librustc_privacy/diagnostics.rs),
6972
[librustc_resolve](https://github.com/rust-lang/rust/blob/master/src/librustc_resolve/diagnostics.rs),
7073
[librustc_trans](https://github.com/rust-lang/rust/blob/master/src/librustc_trans/diagnostics.rs),
74+
[librustc_plugin](https://github.com/rust-lang/rust/blob/master/src/librustc_plugin/diagnostics.rs),
7175
[librustc_typeck](https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/diagnostics.rs).
7276
* Explanations have full markdown support. Use it, especially to highlight
7377
code with backticks.
@@ -79,7 +83,7 @@ code with backticks.
7983
* Flags should be orthogonal to each other. For example, if we'd have a
8084
json-emitting variant of multiple actions `foo` and `bar`, an additional
8185
--json flag is better than adding `--foo-json` and `--bar-json`.
82-
* Always give options a long descriptive name, if only for better
86+
* Always give options a long descriptive name, if only for more
8387
understandable compiler scripts.
8488
* The `--verbose` flag is for adding verbose information to `rustc` output
8589
when not compiling a program. For example, using it with the `--version` flag

0 commit comments

Comments
 (0)