Skip to content

Commit e441b33

Browse files
committed
Auto merge of #7099 - ABouttefeux:master, r=llogiq
add type in help message of from_over_into fixes #7088 changelog: add type in help message of from_over_into
2 parents 831c157 + ccd0f0b commit e441b33

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ 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
1111

0 commit comments

Comments
 (0)