Skip to content

Commit 46074aa

Browse files
authored
Rollup merge of rust-lang#126302 - mu001999-contrib:ignore/default, r=michaelwoerister
Detect unused structs which derived Default <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> --> Fixes rust-lang#98871
2 parents a451b2a + 5d08a54 commit 46074aa

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

alloc/src/sync/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ fn show_arc() {
396396

397397
// Make sure deriving works with Arc<T>
398398
#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Debug, Default)]
399-
struct Foo {
399+
struct _Foo {
400400
inner: Arc<i32>,
401401
}
402402

core/src/default.rs

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ use crate::ascii::Char as AsciiChar;
103103
/// ```
104104
#[cfg_attr(not(test), rustc_diagnostic_item = "Default")]
105105
#[stable(feature = "rust1", since = "1.0.0")]
106+
#[cfg_attr(not(bootstrap), rustc_trivial_field_reads)]
106107
pub trait Default: Sized {
107108
/// Returns the "default value" for a type.
108109
///

0 commit comments

Comments
 (0)