1
1
use super :: * ;
2
2
3
- use crate :: tests:: { Shared } ;
4
3
use crate :: json:: JsonEmitter ;
5
- use crate :: source_map:: { SourceMap , FilePathMapping } ;
4
+ use crate :: source_map:: { FilePathMapping , SourceMap } ;
5
+ use crate :: tests:: Shared ;
6
6
use crate :: with_default_globals;
7
7
8
- use errors:: emitter:: { HumanReadableErrorType , ColorConfig } ;
8
+ use errors:: emitter:: { ColorConfig , HumanReadableErrorType } ;
9
9
use errors:: Handler ;
10
10
use rustc_serialize:: json:: decode;
11
11
use syntax_pos:: { BytePos , Span } ;
@@ -29,7 +29,6 @@ struct SpanTestData {
29
29
30
30
/// Test the span yields correct positions in JSON.
31
31
fn test_positions ( code : & str , span : ( u32 , u32 ) , expected_output : SpanTestData ) {
32
-
33
32
let expected_output = TestData { spans : vec ! [ expected_output] } ;
34
33
35
34
with_default_globals ( || {
@@ -43,7 +42,7 @@ fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) {
43
42
sm,
44
43
true ,
45
44
HumanReadableErrorType :: Short ( ColorConfig :: Never ) ,
46
- false
45
+ false ,
47
46
) ;
48
47
49
48
let span = Span :: with_root_ctxt ( BytePos ( span. 0 ) , BytePos ( span. 1 ) ) ;
@@ -52,7 +51,7 @@ fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) {
52
51
53
52
let bytes = output. lock ( ) . unwrap ( ) ;
54
53
let actual_output = str:: from_utf8 ( & bytes) . unwrap ( ) ;
55
- let actual_output : TestData = decode ( actual_output) . unwrap ( ) ;
54
+ let actual_output: TestData = decode ( actual_output) . unwrap ( ) ;
56
55
57
56
println ! ( "expected output:\n ------\n {:#?}------" , expected_output) ;
58
57
println ! ( "actual output:\n ------\n {:#?}------" , actual_output) ;
@@ -73,7 +72,7 @@ fn empty() {
73
72
column_start : 1 ,
74
73
line_end : 1 ,
75
74
column_end : 2 ,
76
- }
75
+ } ,
77
76
)
78
77
}
79
78
@@ -89,7 +88,7 @@ fn bom() {
89
88
column_start : 1 ,
90
89
line_end : 1 ,
91
90
column_end : 2 ,
92
- }
91
+ } ,
93
92
)
94
93
}
95
94
@@ -105,7 +104,7 @@ fn lf_newlines() {
105
104
column_start : 5 ,
106
105
line_end : 3 ,
107
106
column_end : 3 ,
108
- }
107
+ } ,
109
108
)
110
109
}
111
110
@@ -121,7 +120,7 @@ fn crlf_newlines() {
121
120
column_start : 5 ,
122
121
line_end : 3 ,
123
122
column_end : 3 ,
124
- }
123
+ } ,
125
124
)
126
125
}
127
126
@@ -137,7 +136,7 @@ fn crlf_newlines_with_bom() {
137
136
column_start : 5 ,
138
137
line_end : 3 ,
139
138
column_end : 3 ,
140
- }
139
+ } ,
141
140
)
142
141
}
143
142
@@ -153,7 +152,7 @@ fn span_before_crlf() {
153
152
column_start : 3 ,
154
153
line_end : 1 ,
155
154
column_end : 4 ,
156
- }
155
+ } ,
157
156
)
158
157
}
159
158
@@ -169,7 +168,7 @@ fn span_on_crlf() {
169
168
column_start : 4 ,
170
169
line_end : 2 ,
171
170
column_end : 1 ,
172
- }
171
+ } ,
173
172
)
174
173
}
175
174
@@ -185,6 +184,6 @@ fn span_after_crlf() {
185
184
column_start : 1 ,
186
185
line_end : 2 ,
187
186
column_end : 2 ,
188
- }
187
+ } ,
189
188
)
190
189
}
0 commit comments