@@ -10,7 +10,7 @@ use rustc_lint::{LateContext, LateLintPass};
10
10
use rustc_middle:: ty:: adjustment:: { Adjust , Adjustment } ;
11
11
use rustc_middle:: ty:: Ty ;
12
12
use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
13
- use rustc_span:: { sym, BytePos , ExpnData , ExpnKind , Span , Symbol } ;
13
+ use rustc_span:: { sym, ExpnData , ExpnKind , Span , Symbol } ;
14
14
15
15
declare_clippy_lint ! {
16
16
/// ### What it does
@@ -128,7 +128,7 @@ fn check_format_in_format_args(cx: &LateContext<'_>, call_site: Span, name: Symb
128
128
span_lint_and_then(
129
129
cx,
130
130
FORMAT_IN_FORMAT_ARGS ,
131
- trim_semicolon ( cx , call_site) ,
131
+ call_site,
132
132
& format!( "`format!` in `{}!` args" , name) ,
133
133
|diag| {
134
134
diag. help( & format!(
@@ -192,13 +192,6 @@ fn is_aliased(args: &[FormatArgsArg<'_>], i: usize) -> bool {
192
192
. any ( |( j, arg) | i != j && std:: ptr:: eq ( value, arg. value ) )
193
193
}
194
194
195
- fn trim_semicolon ( cx : & LateContext < ' _ > , span : Span ) -> Span {
196
- snippet_opt ( cx, span) . map_or ( span, |snippet| {
197
- let snippet = snippet. trim_end_matches ( ';' ) ;
198
- span. with_hi ( span. lo ( ) + BytePos ( u32:: try_from ( snippet. len ( ) ) . unwrap ( ) ) )
199
- } )
200
- }
201
-
202
195
fn count_needed_derefs < ' tcx , I > ( mut ty : Ty < ' tcx > , mut iter : I ) -> ( usize , Ty < ' tcx > )
203
196
where
204
197
I : Iterator < Item = & ' tcx Adjustment < ' tcx > > ,
0 commit comments