Auto merge of #7755 - HKalbasi:master, r=xFrednet

exclude enum from derivable impls

fix #7753

changelog: Exclude enum from ``[`derivable_impls`]``
This commit is contained in:
bors 2021-10-03 10:30:16 +00:00
commit 63b04f7d7f
2 changed files with 14 additions and 0 deletions

View file

@ -83,6 +83,7 @@ impl<'tcx> LateLintPass<'tcx> for DerivableImpls {
if !attrs.iter().any(|attr| attr.doc_str().is_some());
if let child_attrs = cx.tcx.hir().attrs(impl_item_hir);
if !child_attrs.iter().any(|attr| attr.doc_str().is_some());
if adt_def.is_struct();
then {
if let TyKind::Path(QPath::Resolved(_, p)) = self_ty.kind {
if let Some(PathSegment { args: Some(a), .. }) = p.segments.last() {

View file

@ -227,4 +227,17 @@ impl Default for RepeatDefault2 {
}
}
// https://github.com/rust-lang/rust-clippy/issues/7753
pub enum IntOrString {
Int(i32),
String(String),
}
impl Default for IntOrString {
fn default() -> Self {
IntOrString::Int(0)
}
}
fn main() {}