Skip to content

Commit 95183ec

Browse files
committed
Fix dead_code lint
1 parent e90c1f6 commit 95183ec

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

compiler/rustc_passes/src/dead.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
268268
}
269269
return true;
270270
}
271+
272+
// ignore generated `DerivedClone` but do not expose this to users.
273+
if Some(trait_of) == self.tcx.get_diagnostic_item(sym::DerivedClone) {
274+
return true;
275+
}
271276
}
272277
}
273278

library/core/src/clone.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ pub struct AssertParamIsCopy<T: Copy + ?Sized> {
178178
reason = "deriving hack, should not be public",
179179
issue = "none"
180180
)]
181+
#[rustc_diagnostic_item = "DerivedClone"]
181182
pub trait DerivedClone: Sized {
182183
fn clone(&self) -> Self;
183184
}

0 commit comments

Comments
 (0)