Skip to content

Commit 2d050f4

Browse files
committed
add type in help of from over Into
1 parent 1e0a3ff commit 2d050f4

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

clippy_lints/src/from_over_into.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl LateLintPass<'_> for FromOverInto {
7373
cx.tcx.sess.source_map().guess_head_span(item.span),
7474
"an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true",
7575
None,
76-
"consider to implement `From` instead",
76+
&format!("consider to implement `From<{}>` instead", impl_trait_ref.self_ty()),
7777
);
7878
}
7979
}

tests/ui/from_over_into.stderr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | impl Into<StringWrapper> for String {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::from-over-into` implied by `-D warnings`
8-
= help: consider to implement `From` instead
8+
= help: consider to implement `From<std::string::String>` instead
99

1010
error: aborting due to previous error
11-

0 commit comments

Comments
 (0)