Skip to content

Commit 8daf694

Browse files
authored
Rollup merge of rust-lang#142485 - mu001999-contrib:dead-code/adt-pattern, r=petrochenkov
Marks ADT live if it appears in pattern Marks ADT live if it appears in pattern, it implies the construction of the ADT. 1. Then we can detect unused private ADTs impl `Default`, without special logics for `Default` and other std traits. 2. We can also remove `rustc_trivial_field_reads` on `Default`, and the logic in `should_ignore_item` (introduced by rust-lang#126302). Fixes rust-lang#120770 Extracted from rust-lang#128637. r? `@petrochenkov`
2 parents 6f6900e + 4470243 commit 8daf694

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

core/src/default.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ use crate::ascii::Char as AsciiChar;
103103
/// ```
104104
#[rustc_diagnostic_item = "Default"]
105105
#[stable(feature = "rust1", since = "1.0.0")]
106-
#[rustc_trivial_field_reads]
107106
pub trait Default: Sized {
108107
/// Returns the "default value" for a type.
109108
///

0 commit comments

Comments
 (0)