Skip to content

Commit 2a2d119

Browse files
committed
better docs per review suggestion
1 parent 706a961 commit 2a2d119

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clippy_lints/src/new_without_default.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ declare_clippy_lint! {
8585
/// }
8686
/// ```
8787
///
88-
/// Alternatively, if the `new()` method requires a non-default initialization, implement a custom `Default`.
89-
/// This also allows you to mark the `new()` implementation as `const`:
88+
/// Alternatively, if the `new()` method requires a non-default initialization, consider renaming
89+
/// it to another less standard name. Lastly, if the `new()` method needs to be `const`,
90+
/// implement a custom `Default`:
9091
///
9192
/// ```no_run
9293
/// struct MyStruct(i32);
@@ -170,7 +171,7 @@ impl<'tcx> LateLintPass<'tcx> for NewWithoutDefault {
170171
{
171172
impls.insert(
172173
cx.tcx.local_def_id_to_hir_id(local_def_id),
173-
if cx.tcx.is_builtin_derived(d) {
174+
if cx.tcx.is_builtin_derived(d.into()) {
174175
DefaultType::AutoDerived
175176
} else {
176177
DefaultType::Manual

0 commit comments

Comments
 (0)