From 1e8a467bc28a742960bcb4b5f7568f6bb384c9bd Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 27 May 2020 09:26:28 -0700 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Who? Me?! Co-authored-by: Chris Simpkins --- src/diagnostics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/diagnostics.md b/src/diagnostics.md index adcf598d..de081bb2 100644 --- a/src/diagnostics.md +++ b/src/diagnostics.md @@ -75,7 +75,7 @@ The descriptions are written in markdown, and all of them are linked in the -[`librustc_error_codes`]: https://github.com/rust-lang/rust/blob/master/src/librustc_error_codes/error_codes.rs +[`librustc_error_codes`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_error_codes/error_codes/index.html [error index]: https://doc.rust-lang.org/error-index.html [RFC 1567]: https://github.com/rust-lang/rfcs/blob/master/text/1567-long-error-codes-explanation-normalization.md @@ -104,7 +104,7 @@ use an error-level lint instead of a fixed error. flag. That said, don't make it so terse that it's hard to understand. - The word "illegal" is illegal. Prefer "invalid" or a more specific word instead. -- Errors should document the span of code where they occur – the `span_..` +- Errors should document the span of code where they occur – the `librustc_errors::diagnostic_builder::DiagnosticBuilder` `span_*` methods allow to easily do this. Also `note` other spans that have contributed to the error if the span isn't too large. - When emitting a message with span, try to reduce the span to the smallest