@@ -109,11 +109,10 @@ use rustc_middle::ty::{FloatTy, IntTy, UintTy};
109109use rustc_semver:: RustcVersion ;
110110use rustc_session:: Session ;
111111use rustc_span:: hygiene:: { ExpnKind , MacroKind } ;
112- use rustc_span:: source_map:: original_sp;
113112use rustc_span:: source_map:: SourceMap ;
114113use rustc_span:: sym;
115114use rustc_span:: symbol:: { kw, Symbol } ;
116- use rustc_span:: { Span , DUMMY_SP } ;
115+ use rustc_span:: Span ;
117116use rustc_target:: abi:: Integer ;
118117
119118use crate :: consts:: { constant, Constant } ;
@@ -1291,23 +1290,6 @@ pub fn contains_return(expr: &hir::Expr<'_>) -> bool {
12911290 . is_some ( )
12921291}
12931292
1294- /// Extends the span to the beginning of the spans line, incl. whitespaces.
1295- ///
1296- /// ```rust
1297- /// let x = ();
1298- /// // ^^
1299- /// // will be converted to
1300- /// let x = ();
1301- /// // ^^^^^^^^^^^^^^
1302- /// ```
1303- fn line_span < T : LintContext > ( cx : & T , span : Span ) -> Span {
1304- let span = original_sp ( span, DUMMY_SP ) ;
1305- let source_map_and_line = cx. sess ( ) . source_map ( ) . lookup_line ( span. lo ( ) ) . unwrap ( ) ;
1306- let line_no = source_map_and_line. line ;
1307- let line_start = source_map_and_line. sf . lines ( |lines| lines[ line_no] ) ;
1308- span. with_lo ( line_start)
1309- }
1310-
13111293/// Gets the parent node, if any.
13121294pub fn get_parent_node ( tcx : TyCtxt < ' _ > , id : HirId ) -> Option < Node < ' _ > > {
13131295 tcx. hir ( ) . parent_iter ( id) . next ( ) . map ( |( _, node) | node)
0 commit comments