@@ -10,7 +10,7 @@ use rustc_lint::{LateContext, LateLintPass};
1010use rustc_middle:: ty:: adjustment:: { Adjust , Adjustment } ;
1111use rustc_middle:: ty:: Ty ;
1212use 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 } ;
1414
1515declare_clippy_lint ! {
1616 /// ### What it does
@@ -128,7 +128,7 @@ fn check_format_in_format_args(cx: &LateContext<'_>, call_site: Span, name: Symb
128128 span_lint_and_then(
129129 cx,
130130 FORMAT_IN_FORMAT_ARGS ,
131- trim_semicolon ( cx , call_site) ,
131+ call_site,
132132 & format!( "`format!` in `{}!` args" , name) ,
133133 |diag| {
134134 diag. help( & format!(
@@ -192,13 +192,6 @@ fn is_aliased(args: &[FormatArgsArg<'_>], i: usize) -> bool {
192192 . any ( |( j, arg) | i != j && std:: ptr:: eq ( value, arg. value ) )
193193}
194194
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-
202195fn count_needed_derefs < ' tcx , I > ( mut ty : Ty < ' tcx > , mut iter : I ) -> ( usize , Ty < ' tcx > )
203196where
204197 I : Iterator < Item = & ' tcx Adjustment < ' tcx > > ,
0 commit comments