@@ -108,11 +108,10 @@ use rustc_middle::ty::{FloatTy, IntTy, UintTy};
108
108
use rustc_semver:: RustcVersion ;
109
109
use rustc_session:: Session ;
110
110
use rustc_span:: hygiene:: { ExpnKind , MacroKind } ;
111
- use rustc_span:: source_map:: original_sp;
112
111
use rustc_span:: source_map:: SourceMap ;
113
112
use rustc_span:: sym;
114
113
use rustc_span:: symbol:: { kw, Ident , Symbol } ;
115
- use rustc_span:: { Span , DUMMY_SP } ;
114
+ use rustc_span:: Span ;
116
115
use rustc_target:: abi:: Integer ;
117
116
118
117
use crate :: consts:: { constant, Constant } ;
@@ -1302,23 +1301,6 @@ pub fn contains_return(expr: &hir::Expr<'_>) -> bool {
1302
1301
. is_some ( )
1303
1302
}
1304
1303
1305
- /// Extends the span to the beginning of the spans line, incl. whitespaces.
1306
- ///
1307
- /// ```rust
1308
- /// let x = ();
1309
- /// // ^^
1310
- /// // will be converted to
1311
- /// let x = ();
1312
- /// // ^^^^^^^^^^^^^^
1313
- /// ```
1314
- fn line_span < T : LintContext > ( cx : & T , span : Span ) -> Span {
1315
- let span = original_sp ( span, DUMMY_SP ) ;
1316
- let source_map_and_line = cx. sess ( ) . source_map ( ) . lookup_line ( span. lo ( ) ) . unwrap ( ) ;
1317
- let line_no = source_map_and_line. line ;
1318
- let line_start = source_map_and_line. sf . lines ( |lines| lines[ line_no] ) ;
1319
- span. with_lo ( line_start)
1320
- }
1321
-
1322
1304
/// Gets the parent node, if any.
1323
1305
pub fn get_parent_node ( tcx : TyCtxt < ' _ > , id : HirId ) -> Option < Node < ' _ > > {
1324
1306
tcx. hir ( ) . parent_iter ( id) . next ( ) . map ( |( _, node) | node)
0 commit comments