Skip to content

Commit 2cd1f79

Browse files
authored
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.
2 parents 04045cc + 58d6f80 commit 2cd1f79

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

compiler/rustc_span/src/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::{Edition, Span, DUMMY_SP, SESSION_GLOBALS};
1818
#[cfg(test)]
1919
mod tests;
2020

21-
// The proc macro code for this is in `src/librustc_macros/src/symbols.rs`.
21+
// The proc macro code for this is in `compiler/rustc_macros/src/symbols.rs`.
2222
symbols! {
2323
// After modifying this list adjust `is_special`, `is_used_keyword`/`is_unused_keyword`,
2424
// this should be rarely necessary though if the keywords are kept in alphabetic order.

library/core/src/default.rs

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
/// bar: f32,
8181
/// }
8282
/// ```
83+
#[cfg_attr(not(test), rustc_diagnostic_item = "Default")]
8384
#[stable(feature = "rust1", since = "1.0.0")]
8485
pub trait Default: Sized {
8586
/// Returns the "default value" for a type.

0 commit comments

Comments
 (0)