@@ -4,7 +4,7 @@ import session::session;
4
4
import syntax:: parse;
5
5
import syntax :: { ast, codemap} ;
6
6
import syntax:: attr;
7
- import middle :: { trans, resolve, freevars, kind, ty, typeck, fn_usage ,
7
+ import middle :: { trans, resolve, freevars, kind, ty, typeck,
8
8
last_use, lint} ;
9
9
import syntax:: print:: { pp, pprust} ;
10
10
import util :: { ppaux, filesearch} ;
@@ -158,12 +158,13 @@ fn compile_upto(sess: session, cfg: ast::crate_cfg,
158
158
bind middle:: block_use:: check_crate ( ty_cx, crate ) ) ;
159
159
time ( time_passes, "loop checking" ,
160
160
bind middle:: check_loop:: check_crate ( ty_cx, crate ) ) ;
161
- time ( time_passes, "function usage" ,
162
- bind fn_usage:: check_crate_fn_usage ( ty_cx, crate ) ) ;
163
161
time ( time_passes, "alt checking" ,
164
162
bind middle:: check_alt:: check_crate ( ty_cx, crate ) ) ;
165
163
time ( time_passes, "typestate checking" ,
166
164
bind middle:: tstate:: ck:: check_crate ( ty_cx, crate ) ) ;
165
+ let _root_map = time (
166
+ time_passes, "borrow checking" ,
167
+ bind middle:: borrowck:: check_crate ( ty_cx, method_map, crate ) ) ;
167
168
let mutbl_map =
168
169
time ( time_passes, "mutability checking" ,
169
170
bind middle:: mutbl:: check_crate ( ty_cx, crate ) ) ;
@@ -401,6 +402,14 @@ fn build_session_options(match: getopts::match,
401
402
let target_opt = getopts:: opt_maybe_str( match , "target" ) ;
402
403
let mut no_asm_comments = getopts:: opt_present( match , "no-asm-comments" ) ;
403
404
let debug_rustc = getopts:: opt_present( match , "debug-rustc" ) ;
405
+ let borrowck = alt getopts:: opt_maybe_str( match , "borrowck" ) {
406
+ none { 0 u }
407
+ some( "warn" ) { 1 u }
408
+ some( "err" ) { 2 u }
409
+ some( _) {
410
+ early_error( demitter, "borrowck may be warn or err" )
411
+ }
412
+ } ;
404
413
alt output_type {
405
414
// unless we're emitting huamn-readable assembly, omit comments.
406
415
link:: output_type_llvm_assembly | link:: output_type_assembly { }
@@ -455,7 +464,8 @@ fn build_session_options(match: getopts::match,
455
464
parse_only : parse_only ,
456
465
no_trans : no_trans ,
457
466
no_asm_comments : no_asm_comments ,
458
- debug_rustc : debug_rustc } ;
467
+ debug_rustc : debug_rustc ,
468
+ borrowck : borrowck } ;
459
469
ret sopts;
460
470
}
461
471
@@ -533,7 +543,8 @@ fn opts() -> [getopts::opt] {
533
543
optmulti ( "cfg" ) , optflag ( "test" ) ,
534
544
optflag ( "lib" ) , optflag ( "bin" ) , optflag ( "static" ) , optflag ( "gc" ) ,
535
545
optflag ( "no-asm-comments" ) ,
536
- optflag ( "debug-rustc" ) ] ;
546
+ optflag ( "debug-rustc" ) ,
547
+ optopt ( "borrowck" ) ] ;
537
548
}
538
549
539
550
type output_filenames = @{ out_filename : str , obj_filename : str } ;
0 commit comments