/// }
/// }
/// ```
+ #[clippy::version = "pre 1.29.0"]
pub NEW_WITHOUT_DEFAULT,
style,
"`fn new() -> Self` method without `Default` implementation"
if sig.decl.inputs.is_empty();
if name == sym::new;
if cx.access_levels.is_reachable(impl_item.def_id);
- let self_def_id = cx.tcx.hir().local_def_id(cx.tcx.hir().get_parent_item(id));
+ let self_def_id = cx.tcx.hir().get_parent_item(id);
let self_ty = cx.tcx.type_of(self_def_id);
if TyS::same_type(self_ty, return_ty(cx, id));
if let Some(default_trait_id) = cx.tcx.get_diagnostic_item(sym::Default);