@@ -15,7 +15,7 @@ use std::io::prelude::*;
1515use std:: path:: Path ;
1616
1717pub struct ExpectedError {
18- pub line : usize ,
18+ pub line_num : usize ,
1919 pub kind : String ,
2020 pub msg : String ,
2121}
@@ -53,15 +53,15 @@ pub fn load_errors(testfile: &Path, cfg: Option<&str>) -> Vec<ExpectedError> {
5353
5454 rdr. lines ( )
5555 . enumerate ( )
56- . filter_map ( |( line_no , ln ) | {
56+ . filter_map ( |( line_num , line ) | {
5757 parse_expected ( last_nonfollow_error,
58- line_no + 1 ,
59- & ln . unwrap ( ) ,
58+ line_num + 1 ,
59+ & line . unwrap ( ) ,
6060 & tag)
6161 . map ( |( which, error) | {
6262 match which {
6363 FollowPrevious ( _) => { }
64- _ => last_nonfollow_error = Some ( error. line ) ,
64+ _ => last_nonfollow_error = Some ( error. line_num ) ,
6565 }
6666 error
6767 } )
@@ -91,22 +91,21 @@ fn parse_expected(last_nonfollow_error: Option<usize>,
9191 . skip_while ( |c| !c. is_whitespace ( ) )
9292 . collect :: < String > ( ) . trim ( ) . to_owned ( ) ;
9393
94- let ( which, line ) = if follow {
94+ let ( which, line_num ) = if follow {
9595 assert ! ( adjusts == 0 , "use either //~| or //~^, not both." ) ;
96- let line = last_nonfollow_error. expect ( "encountered //~| without \
97- preceding //~^ line.") ;
98- ( FollowPrevious ( line ) , line )
96+ let line_num = last_nonfollow_error. expect ( "encountered //~| without \
97+ preceding //~^ line.") ;
98+ ( FollowPrevious ( line_num ) , line_num )
9999 } else {
100100 let which =
101101 if adjusts > 0 { AdjustBackward ( adjusts) } else { ThisLine } ;
102- let line = line_num - adjusts;
103- ( which, line )
102+ let line_num = line_num - adjusts;
103+ ( which, line_num )
104104 } ;
105105
106106 debug ! ( "line={} tag={:?} which={:?} kind={:?} msg={:?}" ,
107107 line_num, tag, which, kind, msg) ;
108-
109- Some ( ( which, ExpectedError { line : line,
108+ Some ( ( which, ExpectedError { line_num : line_num,
110109 kind : kind,
111110 msg : msg, } ) )
112111}
0 commit comments