diff options
| author | Mara <m-ou.se@m-ou.se> | 2021-03-05 10:57:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-05 10:57:24 +0100 |
| commit | 2cd1f79aa1563f9d1aa51c628bc7ecfd6dff40ce (patch) | |
| tree | 50dbc86ed3e989f689805af942d8a005b3efa02e | |
| parent | 04045cc83f59e08be5d12d7ca4ac4d6364a02ff1 (diff) | |
| parent | 58d6f80f96a7e53fcafaa9ca42a7a8d6f8fa7444 (diff) | |
| download | rust-2cd1f79aa1563f9d1aa51c628bc7ecfd6dff40ce.tar.gz rust-2cd1f79aa1563f9d1aa51c628bc7ecfd6dff40ce.zip | |
Rollup merge of #82773 - mgacek8:feature/add_diagnostic_item_to_Default_trait, r=oli-obk
Add diagnostic item to `Default` trait This PR adds diagnostic item to `Default` trait to be used by rust-lang/rust-clippy#6562 issue. Also fixes the obsolete path to the `symbols.rs` file in the comment.
| -rw-r--r-- | compiler/rustc_span/src/symbol.rs | 2 | ||||
| -rw-r--r-- | library/core/src/default.rs | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index cd47b714db5..9663760cba1 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. diff --git a/library/core/src/default.rs b/library/core/src/default.rs index 28ec3279459..fd7159d35fa 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. |
