File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ impl LateLintPass<'_> for FromOverInto {
70
70
span_lint_and_help(
71
71
cx,
72
72
FROM_OVER_INTO ,
73
- item. span,
73
+ cx . tcx . sess . source_map ( ) . guess_head_span ( item. span) ,
74
74
"an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true" ,
75
75
None ,
76
76
"consider to implement `From` instead" ,
Original file line number Diff line number Diff line change 1
1
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
2
2
--> $DIR/from_over_into.rs:6:1
3
3
|
4
- LL | / impl Into<StringWrapper> for String {
5
- LL | | fn into(self) -> StringWrapper {
6
- LL | | StringWrapper(self)
7
- LL | | }
8
- LL | | }
9
- | |_^
4
+ LL | impl Into<StringWrapper> for String {
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10
6
|
11
7
= note: `-D clippy::from-over-into` implied by `-D warnings`
12
8
= help: consider to implement `From` instead
You can’t perform that action at this time.
0 commit comments