mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-10 02:56:52 +00:00
Reduce the span in from_over_into
to impl header
This commit is contained in:
parent
8e5c5a64a5
commit
0e14a75506
@ -70,7 +70,7 @@ impl LateLintPass<'_> for FromOverInto {
|
||||
span_lint_and_help(
|
||||
cx,
|
||||
FROM_OVER_INTO,
|
||||
item.span,
|
||||
cx.tcx.sess.source_map().guess_head_span(item.span),
|
||||
"an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true",
|
||||
None,
|
||||
"consider to implement `From` instead",
|
||||
|
@ -1,12 +1,8 @@
|
||||
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
|
||||
--> $DIR/from_over_into.rs:6:1
|
||||
|
|
||||
LL | / impl Into<StringWrapper> for String {
|
||||
LL | | fn into(self) -> StringWrapper {
|
||||
LL | | StringWrapper(self)
|
||||
LL | | }
|
||||
LL | | }
|
||||
| |_^
|
||||
LL | impl Into<StringWrapper> for String {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D clippy::from-over-into` implied by `-D warnings`
|
||||
= help: consider to implement `From` instead
|
||||
|
Loading…
Reference in New Issue
Block a user