From a5951d4b238947479b4851eb491f8cc76bf103ee Mon Sep 17 00:00:00 2001 From: Mateusz Gacek <96mateusz.gacek@gmail.com> Date: Thu, 4 Mar 2021 10:09:02 -0800 Subject: [PATCH 1/2] Add diagnostic item to `Default` trait Required to resolve #6562 rust-clippy issue. --- library/core/src/default.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/core/src/default.rs b/library/core/src/default.rs index 28ec3279459ab..fd7159d35fa7f 100644 --- a/library/core/src/default.rs +++ b/library/core/src/default.rs @@ -80,6 +80,7 @@ /// bar: f32, /// } /// ``` +#[cfg_attr(not(test), rustc_diagnostic_item = "Default")] #[stable(feature = "rust1", since = "1.0.0")] pub trait Default: Sized { /// Returns the "default value" for a type. From 58d6f80f96a7e53fcafaa9ca42a7a8d6f8fa7444 Mon Sep 17 00:00:00 2001 From: Mateusz Gacek <96mateusz.gacek@gmail.com> Date: Thu, 4 Mar 2021 10:13:53 -0800 Subject: [PATCH 2/2] Fix comment with path to `symbols!` macro --- compiler/rustc_span/src/symbol.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 27bb45bcc8512..63ecc4b36d3ea 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -18,7 +18,7 @@ use crate::{Edition, Span, DUMMY_SP, SESSION_GLOBALS}; #[cfg(test)] mod tests; -// The proc macro code for this is in `src/librustc_macros/src/symbols.rs`. +// The proc macro code for this is in `compiler/rustc_macros/src/symbols.rs`. symbols! { // After modifying this list adjust `is_special`, `is_used_keyword`/`is_unused_keyword`, // this should be rarely necessary though if the keywords are kept in alphabetic order.