## Crater report analysis *Context: We did a crater run were we temporarily put the lint to deny-by-default, and here are the results.* Affected projects: 7057 / 851203 (0.82%) Total errors: 116165 Total errors from derive macros: 107531 (across 259 different derive macros) Total errors from macro_rules!: 2150 (across 117 different `macro_rules!`) Total errors (manual, not above): 6484 ### Derive macros <details> Total errors from derive macros **fixed upstream**: 84315 (78.4%) Total errors from derive macros **NOT fixed upstream**: 12660 (11.8%) Total errors from derive macros **deprecated**: 5397 (5.0%) Total errors from derive macros **uncategorised**: 5159 (4.8%) - `Deserialize`: 26154 (status: fixed in serde_derive) - `QueryId`: 25116 (status: fixed in diesel_derives) - `Serialize`: 20385 (status: fixed in serde_derive) - `Fail`: 5303 (status: deprecated) - `FromPrimitive`: 4649 (status: not-fixed) - `Queryable`: 3570 (status: fixed in diesel_derives) - `Insertable`: 2889 (status: fixed in diesel_derives) - `ToPrimitive`: 2010 (status: not-fixed) - `YaDeserialize`: 1454 (status: not-fixed) - `YaSerialize`: 1424 (status: not-fixed) - `Identifiable`: 1159 (status: fixed in diesel_derives) - `PeekPoke`: 822 (status: not-fixed) - `Trace`: 810 (status: fixed in gc) - `AsChangeset`: 763 (status: fixed in diesel_derives) - `Error`: 738 (status: not-fixed) - `Collect`: 730 (status: fixed in gc-arena-derive) - `Display`: 566 (status: not-fixed) - `Endpoint`: 468 (status: not-fixed) - `Finalize`: 405 (status: fixed in gc) - `serde::Deserialize`: 386 (status: fixed in serde_derive) - `Associations`: 347 (status: fixed in diesel_derives) - `serde::Serialize`: 315 (status: fixed in serde_derive) - `Command`: 305 (status: fixed in structopt) - `Savefile`: 296 (status: not-fixed) - `FromPest`: 270 (status: fixed in from-pest) - `Abomonation`: 262 (status: n/a) - `Arbitrary`: 257 (status: n/a) - `sp::FieldOffsets`: 210 (status: n/a) - `DieselNumericOps`: 184 (status: fixed in diesel_derives) - `QueryableByName`: 176 (status: fixed in diesel_derives) - `displaydoc::Display`: 159 (status: n/a) - `num_derive::FromPrimitive`: 152 (status: not-fixed) - `proptest_derive::Arbitrary`: 151 (status: n/a) - `WidgetCommon_`: 136 (status: n/a) - `FromSqlRow`: 126 (status: n/a) - `TlWrite`: 126 (status: n/a) - `StructOpt`: 123 (status: fixed in structopt) - `serde_derive::Deserialize`: 120 (status: fixed in serde_derive) - `Protocol`: 117 (status: n/a) - `TlRead`: 110 (status: n/a) - `serde_derive::Serialize`: 108 (status: fixed in serde_derive) - `WidgetStyle_`: 104 (status: n/a) - `Sparsable`: 103 (status: n/a) - `sixtyfps::re_exports::FieldOffsets`: 100 (status: n/a) - `AsExpression`: 98 (status: n/a) - `HasInterner`: 98 (status: n/a) - `OApiCheck`: 98 (status: n/a) - `Zeroize`: 97 (status: n/a) - `failure::Fail`: 94 (status: deprecated) - `err_derive::Error`: 88 (status: n/a) - `FieldOffsets`: 87 (status: n/a) - `num_derive::ToPrimitive`: 81 (status: not-fixed) - `Fold`: 70 (status: n/a) - `Header`: 70 (status: n/a) - `Runnable`: 69 (status: n/a) - `custom_debug_derive::Debug`: 66 (status: n/a) - `OApiExt`: 66 (status: n/a) - `Debug`: 65 (status: n/a) - `Message`: 60 (status: n/a) - `near_sdk::serde::Serialize`: 60 (status: n/a) - `Recap`: 59 (status: n/a) - `Visit`: 56 (status: n/a) - `slint::re_exports::FieldOffsets`: 52 (status: n/a) - `custom_debug::Debug`: 48 (status: n/a) - `SqlType`: 44 (status: n/a) - `ZeroizeOnDrop`: 44 (status: n/a) - `H5Type`: 43 (status: n/a) - `MontConfig`: 42 (status: n/a) - `AstClone`: 42 (status: n/a) - `debug2::Debug`: 40 (status: n/a) - `Value`: 38 (status: n/a) - `BartDisplay`: 37 (status: n/a) - `diesel::Queryable`: 36 (status: n/a) - `OpgModel`: 36 (status: n/a) - `Encode`: 35 (status: n/a) - `Decode`: 35 (status: n/a) - `QueryEndpoint`: 34 (status: n/a) - `RequestContext`: 32 (status: n/a) - `GraphQLInputObject`: 32 (status: n/a) - `Zip`: 32 (status: n/a) - `Scan`: 31 (status: n/a) - `Gtmpl`: 30 (status: n/a) - `VmType`: 28 (status: n/a) - `::pin_project::__private::__PinProjectInternalDerive`: 28 (status: n/a) - `slint::private_unstable_api::re_exports::FieldOffsets`: 28 (status: n/a) - `DieselNewType`: 27 (status: n/a) - `FromRequest`: 27 (status: n/a) - `potatonet::serde_derive::Serialize`: 26 (status: n/a) - `potatonet::serde_derive::Deserialize`: 26 (status: n/a) - `CustomDebug`: 26 (status: n/a) - `Prim`: 26 (status: n/a) - `BoundTerm`: 25 (status: n/a) - `IntEnum`: 24 (status: n/a) - `ark_ff::MontConfig`: 23 (status: n/a) - `ArrowDeserialize`: 23 (status: n/a) - `WidgetCommon`: 20 (status: n/a) - `ErrorKind`: 20 (status: n/a) - `Model`: 19 (status: n/a) - `diesel::Identifiable`: 18 (status: n/a) - `AppRoute`: 16 (status: n/a) - `Hash32`: 16 (status: n/a) - `WidgetStyle`: 16 (status: n/a) - `ModuleBase`: 16 (status: n/a) - `Component`: 14 (status: n/a) - `quickcheck_derive::Arbitrary`: 14 (status: n/a) - `gio::glib::ValueDelegate`: 14 (status: n/a) - `GC`: 13 (status: n/a) - `glib::Variant`: 13 (status: n/a) - `Getable`: 13 (status: n/a) - `Zero`: 13 (status: n/a) - `One`: 13 (status: n/a) - `Num`: 13 (status: n/a) - `Odbc`: 12 (status: n/a) - `OscMessage`: 12 (status: n/a) - `Dbg`: 12 (status: n/a) - `Enumeration`: 12 (status: n/a) - `diesel::Insertable`: 12 (status: n/a) - `common::serde::SerializeWithCtx`: 12 (status: n/a) - `DebugWithCtx`: 12 (status: n/a) - `Pushable`: 11 (status: n/a) - `Table`: 11 (status: n/a) - `PrefixOpt`: 11 (status: n/a) - `ConstructorMacro`: 10 (status: n/a) - `hdf5::H5Type`: 10 (status: n/a) - `Encodable`: 10 (status: n/a) - `FromDynamic`: 10 (status: n/a) - `diesel::Associations`: 10 (status: n/a) - `ToDynamic`: 9 (status: n/a) - `AironeDbDerive`: 8 (status: n/a) - `FiniteAutomataConstructor`: 8 (status: n/a) - `hash32_derive::Hash32`: 8 (status: n/a) - `NewFuzzed`: 8 (status: n/a) - `NumCast`: 8 (status: n/a) - `Float`: 8 (status: n/a) - `StructDeser`: 8 (status: n/a) - `::num_derive::FromPrimitive`: 8 (status: n/a) - `::num_derive::ToPrimitive`: 8 (status: n/a) - `abomonation_derive::Abomonation`: 8 (status: n/a) - `SuperFoldable`: 8 (status: n/a) - `Alga`: 7 (status: n/a) - `gff_derive::GFFStruct`: 7 (status: n/a) - `Zvt`: 7 (status: n/a) - `$crate::codec::Encode`: 7 (status: n/a) - `$crate::codec::Decode`: 7 (status: n/a) - `ValueDelegate`: 6 (status: n/a) - `Userdata`: 6 (status: n/a) - `KittyCommand`: 6 (status: n/a) - `BoundPattern`: 6 (status: n/a) - `Into`: 6 (status: n/a) - `TypeInfo`: 6 (status: n/a) - `TypeDesc`: 6 (status: n/a) - `DerSequence`: 6 (status: n/a) - `miniserde::Serialize`: 6 (status: n/a) - `GraphQLEnum`: 6 (status: n/a) - `opg::OpgModel`: 6 (status: n/a) - `CustumDebug`: 6 (status: n/a) - `ResultLike`: 5 (status: n/a) - `OptionLike`: 5 (status: n/a) - `SparsableInner`: 5 (status: n/a) - `PropTestArbitrary`: 5 (status: n/a) - `microserde::Serialize`: 4 (status: n/a) - `cs::Debug`: 4 (status: n/a) - `ViaSerialize`: 4 (status: n/a) - `ViaDeserialize`: 4 (status: n/a) - `tl_proto::TlRead`: 4 (status: n/a) - `tl_proto::TlWrite`: 4 (status: n/a) - `Key`: 4 (status: n/a) - `Uniform`: 4 (status: n/a) - `LambdaErrorExt`: 4 (status: n/a) - `failure_derive::Fail`: 4 (status: n/a) - `Absorb`: 4 (status: n/a) - `Emit`: 4 (status: n/a) - `Serializer`: 4 (status: n/a) - `diesel_derive_newtype::DieselNewType`: 4 (status: n/a) - `DocDefault`: 4 (status: n/a) - `Interpolate`: 4 (status: n/a) - `StableAbi`: 4 (status: n/a) - `diesel::QueryableByName`: 4 (status: n/a) - `Bson`: 4 (status: n/a) - `SuperVisit`: 4 (status: n/a) - `diesel::AsExpression`: 4 (status: n/a) - `diesel::FromSqlRow`: 4 (status: n/a) - `::cliff::serde::Serialize`: 4 (status: n/a) - `::cliff::serde::Deserialize`: 4 (status: n/a) - `Foldable`: 4 (status: n/a) - `serde1::Deserialize`: 4 (status: n/a) - `serde2::Deserialize`: 4 (status: n/a) - `EnumToStr`: 3 (status: n/a) - `elise::GC`: 3 (status: n/a) - `EnumDisplay`: 3 (status: n/a) - `Coerce`: 3 (status: n/a) - `glib::Enum`: 3 (status: n/a) - `IriEnum`: 3 (status: n/a) - `Document`: 3 (status: n/a) - `Limit`: 3 (status: n/a) - `ReParse`: 3 (status: n/a) - `From`: 3 (status: n/a) - `Config`: 2 (status: n/a) - `derive_resource_impl`: 2 (status: n/a) - `$crate::diesel_derive_newtype::DieselNewType`: 2 (status: n/a) - `Lens`: 2 (status: n/a) - `rkyv::Deserialize`: 2 (status: n/a) - `GridCell`: 2 (status: n/a) - `GantzNode_`: 2 (status: n/a) - `Bake`: 2 (status: n/a) - `glib::SharedBoxed`: 2 (status: n/a) - `glib::Boxed`: 2 (status: n/a) - `gluon_codegen::AstClone`: 2 (status: n/a) - `DagCbor`: 2 (status: n/a) - `Extract`: 2 (status: n/a) - `Response`: 2 (status: n/a) - `protocol::Protocol`: 2 (status: n/a) - `der::Message`: 2 (status: n/a) - `Unsigned`: 2 (status: n/a) - `Signed`: 2 (status: n/a) - `Cacheable`: 2 (status: n/a) - `DisplayDoc`: 2 (status: n/a) - `::pin_project::__private::__PinProjectAutoImplUnpin`: 2 (status: n/a) - `TrackableError`: 2 (status: n/a) - `const_field_offset::FieldOffsets`: 2 (status: n/a) - `miniserde::Deserialize`: 2 (status: n/a) - `self::sr_api_hidden_includes_decl_storage::hidden_include::codec::Encode`: 2 (status: n/a) - `self::sr_api_hidden_includes_decl_storage::hidden_include::codec::Decode`: 2 (status: n/a) - `self::sr_api_hidden_includes_decl_storage::hidden_include::Serialize`: 2 (status: n/a) - `self::sr_api_hidden_includes_decl_storage::hidden_include::Deserialize`: 2 (status: n/a) - `ElasticType`: 2 (status: n/a) - `SerializeState`: 2 (status: n/a) - `Vertex`: 2 (status: n/a) - `Uniforms`: 2 (status: n/a) - `recap::Recap`: 2 (status: n/a) - `asn1_rs::DerSequence`: 2 (status: n/a) - `FromInner`: 2 (status: n/a) - `CompactTypeId`: 2 (status: n/a) - `NamedType`: 2 (status: n/a) - `int_enum::IntEnum`: 2 (status: n/a) - `scale_info::TypeInfo`: 2 (status: n/a) - `bart_derive::BartDisplay`: 1 (status: n/a) - `MultihashDigest`: 1 (status: n/a) - `EnumTryInto`: 1 (status: n/a) - `ParquetRecordWriter`: 1 (status: n/a) - `zvariant::OwnedValue`: 1 (status: n/a) - `Hashable`: 1 (status: n/a) - `IntoPrimitive`: 1 (status: n/a) - `GuestType`: 1 (status: n/a) - `Instruments`: 1 (status: n/a) - `LogicStruct`: 1 (status: n/a) - `AsStd140`: 1 (status: n/a) - `FinalizeFields`: 1 (status: n/a) - `Multihash`: 1 (status: n/a) - `Builder`: 1 (status: n/a) - `Synonym`: 1 (status: n/a) - `WrappedVec`: 1 (status: n/a) - `DatastoreManaged`: 1 (status: n/a) - `CEnum`: 1 (status: n/a) - `FilterNodes`: 1 (status: n/a) - `Parse`: 1 (status: n/a) - `Spanned`: 1 (status: n/a) - `MiniSerialize`: 1 (status: n/a) - `MiniDeserialize`: 1 (status: n/a) </details> ### `macro_rules!` <details> - `$crate::py_class_impl`: 208 - `$crate::_pair`: 168 - `ComponentVTable_static`: 168 - `$crate::_single`: 108 - `$crate::impl_mul_for_primitive`: 100 - `$crate::pyobject_native_type_named`: 96 - `$crate::__private_maparr`: 88 - `implement_vertex`: 78 - `_pyo3::impl_::pyclass::generate_pyclass_richcompare_slot`: 66 - `$crate::impl_dyn_cast_config`: 57 - `ItemTreeVTable_static`: 56 - `$crate::impl_dyn_cast`: 54 - `$crate::impl_try_from_for_primitive`: 50 - `$crate::construct_uint`: 35 - `$crate::impl_exception_boilerplate`: 32 - `$crate::pyobject_native_type_extract`: 32 - `$crate::__define_v_table_internal`: 32 - `$crate::__internal_clone_trait_object`: 24 - `enum_unitary`: 24 - `impl_point_and_envelope`: 24 - `::cast_trait_object::impl_dyn_cast_config`: 24 - `eager_macro_rules_internal`: 22 - `impl_trait`: 20 - `test_binary`: 20 - `add_from`: 20 - `flash_impl`: 19 - `$crate::define_udt`: 18 - `lex_rule`: 18 - `$crate::glib_object_wrapper`: 16 - `value_enum`: 16 - `impl_unsigned_varint`: 16 - `$crate::impl_serialize_primitive`: 16 - `$crate::impl_state_primitive`: 16 - `$crate::impl_meta_primitive`: 16 - `impl_signed_varint`: 16 - `signed`: 15 - `unsigned`: 15 - `define_ext`: 12 - `create_lineariseable_data_type`: 12 - `manual`: 12 - `flexible`: 12 - `create_color_matcher_or_alterator`: 12 - `bitflags_set`: 12 - `$crate::impl_mul_from`: 10 - `construct_uint`: 10 - `scoped_thread_local`: 10 - `integer_array::declare_array_real`: 9 - `declare_array_real`: 9 - `impl_dyn_cast`: 9 - `impl_poem_type`: 8 - `scoped_tls_hkt::scoped_thread_local`: 8 - `::cast_trait_object::impl_dyn_cast`: 8 - `glium::implement_vertex`: 8 - `codegen_define_method`: 8 - `define_str_enum`: 8 - `library`: 7 - `rkyv_dyn::register_impl`: 6 - `holochain_serial`: 6 - `float`: 6 - `define_q_num`: 6 - `crate::impl_dyn_cast`: 6 - `reflect::library`: 5 - `zerocopy_value_codec`: 5 - `make_from_iterator`: 4 - `py_class_impl`: 4 - `__array_impls`: 4 - `basic`: 4 - `class_extends`: 4 - `crate::class_extends`: 4 - `make_header`: 4 - `test_unary`: 4 - `singleton_backcompat`: 4 - `stringy`: 4 - `$crate::_internal_impl_common`: 4 - `rustler::resource`: 4 - `baseplug::model`: 4 - `$crate::env_config`: 4 - `metamodel_macros::generate_model_from_tuple`: 4 - `max_impl`: 4 - `$crate::__declare_length_type_and_pass`: 3 - `$crate::new_error_struct`: 3 - `define_ranged_enum`: 3 - `amethyst_assets::register_format_type`: 2 - `impl_poem_parameter`: 2 - `enhanced_enum`: 2 - `utils::ident_str`: 2 - `ident_str`: 2 - `from_prim`: 2 - `print_item_resolve_later_demonstration`: 2 - `prost_into_vec`: 2 - `vec_try_into_prost`: 2 - `prost_into_bytes`: 2 - `declare_new_type`: 2 - `impl_SliceIndex`: 2 - `inventory::collect`: 2 - `impl_noop_disconnect_and_handshake`: 2 - `impl_from_num_for_json`: 2 - `assoc_static`: 1 - `autofolder_impl_foldertrait`: 1 - `autofolder_impl_reducetrait`: 1 - `$crate::__c_enum_no_debug`: 1 - `plugin_registry`: 1 - `$crate::new_error_enum`: 1 - `crate::constrained_string`: 1 - `clamp`: 1 - `bytes_try_into_prost`: 1 - `newtype`: 1 - `derive_display_from_serialize`: 1 - `derive_serialize_from_display`: 1 - `$crate::assoc_static`: 1 - `$crate::assoc_threadlocal`: 1 - `$crate::stack`: 1 - `derive_AsRef_for_auto_trait_combination`: 1 - `derive_AsMut_for_auto_trait_combination`: 1 - `$crate::bitfield_without_debug`: 1 - `deprecated_from`: 1 - `specification`: 1 </details> ### Manual (not derive or macro_rules!) <details> Inside: - `function`: 2357 - `method`: 1866 - `constant`: 1800 - `static`: 180 - `async block`: 139 - `associated function`: 80 - `async fn`: 32 - `closure`: 22 - `associated constant`: 8 </details> ------ ### Summary In conclusion, this crater run revealed that making the lint deny-by-default (which is NOT default that would would be used, it would be warn-by-default) would break 7057 crates / 851203 crates tested (0.82%), there was a total of 116165 errors, of which 107531 (92.6%) errors were coming from derives macros, 2150 were coming from `macro_rules!` and 6484 errors are not coming from either of them. Analysing the root of those derives and macros revealed many outdated versions of `serde_derive` and `diesel_derives`, representing nearly 74% of the total errors alone, as well 6 different derive crates that represent 11.4% that would need to be updated. To put it simply: - 84523 (76.3%) errors would be fixed by `cargo update` (representing 6104 different crates) - 12660 (11.4%) errors that could fixed by upstream change (at least 6 different derive crates) - 6484 (5.9%) errors requires manual intervention (788 different crates) - 7309 (6.6%) uncategorised errors (probably manual intervention and deps change): The author of this PR (@Urgau) thinks those are acceptable numbers, in more that 3/4 of cases a `cargo update` would fix the warnings and by fixing 6 different derives we could get to 90%, the rest of cases would need manual interventions, but some intervention are to be expected. *Reminder that the lint is warn-by-default, so it wouldn't break anyone!*