@@ -51,6 +51,7 @@ fn check_crate(@ty::ctxt tcx, &@ast::crate crate) {
51
51
visit_expr=bind visit_expr ( cx, _, _, _)
52
52
with * visit:: default_visitor[ scope] ( ) ) ;
53
53
visit:: visit_crate ( * crate , [ ] , visit:: vtor ( v) ) ;
54
+ tcx. sess . abort_if_errors ( ) ;
54
55
}
55
56
56
57
fn visit_fn ( @ctx cx , & ast:: _fn f, & vec[ ast:: ty_param ] tp , & span sp,
@@ -93,7 +94,7 @@ fn visit_expr(@ctx cx, &@ast::expr ex, &scope sc, &vt[scope] v) {
93
94
case ( some ( ?ex) ) {
94
95
auto root = expr_root ( * cx, ex, false ) ;
95
96
if ( mut_field ( root. ds ) ) {
96
- cx. tcx . sess . span_fatal ( ex. span ,
97
+ cx. tcx . sess . span_err ( ex. span ,
97
98
"result of put must be" +
98
99
" immutably rooted" ) ;
99
100
}
@@ -153,7 +154,7 @@ fn check_call(&ctx cx, &@ast::expr f, &vec[@ast::expr] args, &scope sc) ->
153
154
auto m =
154
155
"passing a temporary value or \
155
156
immutable field by mutable alias";
156
- cx. tcx . sess . span_fatal ( arg. span , m) ;
157
+ cx. tcx . sess . span_err ( arg. span , m) ;
157
158
}
158
159
}
159
160
}
@@ -176,7 +177,7 @@ fn check_call(&ctx cx, &@ast::expr f, &vec[@ast::expr] args, &scope sc) ->
176
177
alt ( f. node ) {
177
178
case ( ast:: expr_path ( _) ) {
178
179
if ( def_is_local ( cx. tcx . def_map . get ( f. id ) , true ) ) {
179
- cx. tcx . sess . span_fatal ( f. span ,
180
+ cx. tcx . sess . span_err ( f. span ,
180
181
#fmt ( "function may alias with \
181
182
argument %u, which is not immutably rooted",
182
183
unsafe_t_offsets. ( 0 ) ) ) ;
@@ -195,7 +196,7 @@ fn check_call(&ctx cx, &@ast::expr f, &vec[@ast::expr] args, &scope sc) ->
195
196
if ( i ! = offset &&
196
197
ty_can_unsafely_include( cx, unsafe , arg_t. ty, mut_alias) )
197
198
{
198
- cx. tcx. sess. span_fatal ( args. ( i) . span,
199
+ cx. tcx. sess. span_err ( args. ( i) . span,
199
200
#fmt( "argument %u may alias with \
200
201
argument %u, which is not immutably rooted",
201
202
i, offset) ) ;
@@ -213,7 +214,7 @@ fn check_call(&ctx cx, &@ast::expr f, &vec[@ast::expr] args, &scope sc) ->
213
214
}
214
215
}
215
216
if ( mut_alias_to_root) {
216
- cx. tcx. sess. span_fatal ( args. ( root. _0) . span,
217
+ cx. tcx. sess. span_err ( args. ( root. _0) . span,
217
218
"passing a mutable alias to a \
218
219
variable that roots another alias") ;
219
220
}
@@ -239,7 +240,7 @@ fn check_tail_call(&ctx cx, &@ast::expr call) {
239
240
alt ( cx. local_map. find( dnum) ) {
240
241
case ( some( arg( ast:: alias( ?mut ) ) ) ) {
241
242
if ( mut_a && !mut) {
242
- cx. tcx. sess. span_fatal ( args. ( i) . span,
243
+ cx. tcx. sess. span_err ( args. ( i) . span,
243
244
"passing an immutable \
244
245
alias by mutable alias") ;
245
246
}
@@ -250,7 +251,7 @@ fn check_tail_call(&ctx cx, &@ast::expr call) {
250
251
case ( _) { ok = false ; }
251
252
}
252
253
if ( !ok) {
253
- cx. tcx. sess. span_fatal ( args. ( i) . span,
254
+ cx. tcx. sess. span_err ( args. ( i) . span,
254
255
"can not pass a local value by \
255
256
alias to a tail call") ;
256
257
}
@@ -386,10 +387,10 @@ fn check_lval(&@ctx cx, &@ast::expr dest, &scope sc, &vt[scope] v) {
386
387
case ( ast:: expr_path ( ?p) ) {
387
388
auto dnum = ast:: def_id_of_def ( cx. tcx . def_map . get ( dest. id ) ) . _1 ;
388
389
if ( is_immutable_alias ( cx, sc, dnum) ) {
389
- cx. tcx . sess . span_fatal ( dest. span ,
390
+ cx. tcx . sess . span_err ( dest. span ,
390
391
"assigning to immutable alias" ) ;
391
392
} else if ( is_immutable_objfield ( cx, dnum) ) {
392
- cx. tcx . sess . span_fatal ( dest. span ,
393
+ cx. tcx . sess . span_err ( dest. span ,
393
394
"assigning to immutable obj field" ) ;
394
395
}
395
396
for ( restrict r in sc) {
@@ -402,15 +403,15 @@ fn check_lval(&@ctx cx, &@ast::expr dest, &scope sc, &vt[scope] v) {
402
403
case ( _) {
403
404
auto root = expr_root ( * cx, dest, false ) ;
404
405
if ( vec:: len ( root. ds ) == 0 u) {
405
- cx. tcx . sess . span_fatal ( dest. span , "assignment to non-lvalue" ) ;
406
+ cx. tcx . sess . span_err ( dest. span , "assignment to non-lvalue" ) ;
406
407
} else if ( !root. ds . ( 0 ) . mut ) {
407
408
auto name =
408
409
alt ( root. ds . ( 0 ) . kind ) {
409
410
case ( unbox) { "box" }
410
411
case ( field) { "field" }
411
412
case ( index) { "vec content" }
412
413
} ;
413
- cx. tcx . sess . span_fatal ( dest. span ,
414
+ cx. tcx . sess . span_err ( dest. span ,
414
415
"assignment to immutable " + name) ;
415
416
}
416
417
visit_expr ( cx, dest, sc, v) ;
@@ -456,7 +457,7 @@ fn test_scope(&ctx cx, &scope sc, &restrict r, &ast::path p) {
456
457
tup ( sp, "taking the value of " + ast:: path_name ( vpt) )
457
458
}
458
459
} ;
459
- cx. tcx . sess . span_fatal ( msg. _0 ,
460
+ cx. tcx . sess . span_err ( msg. _0 ,
460
461
msg. _1 + " will invalidate alias " +
461
462
ast:: path_name ( p) + ", which is still used" ) ;
462
463
}
0 commit comments