mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
exclude enum from derivable impls
This commit is contained in:
parent
da3b4b4594
commit
ea8e65f0da
@ -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_enum();
|
||||
then {
|
||||
if let TyKind::Path(QPath::Resolved(_, p)) = self_ty.kind {
|
||||
if let Some(PathSegment { args: Some(a), .. }) = p.segments.last() {
|
||||
|
@ -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() {}
|
||||
|
Loading…
Reference in New Issue
Block a user