File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/librustc/middle/typeck/check Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -138,15 +138,19 @@ pub impl Rcx {
138
138
139
139
pub fn regionck_expr ( fcx : @mut FnCtxt , e : @ast:: expr ) {
140
140
let rcx = @mut Rcx { fcx : fcx, errors_reported : 0 } ;
141
- let v = regionck_visitor ( ) ;
142
- ( v. visit_expr ) ( e, rcx, v) ;
141
+ if !fcx. tcx ( ) . sess . has_errors ( ) { // regionck assumes typeck succeeded
142
+ let v = regionck_visitor ( ) ;
143
+ ( v. visit_expr ) ( e, rcx, v) ;
144
+ }
143
145
fcx. infcx ( ) . resolve_regions ( ) ;
144
146
}
145
147
146
148
pub fn regionck_fn ( fcx : @mut FnCtxt , blk : & ast:: blk ) {
147
149
let rcx = @mut Rcx { fcx : fcx, errors_reported : 0 } ;
148
- let v = regionck_visitor ( ) ;
149
- ( v. visit_block ) ( blk, rcx, v) ;
150
+ if !fcx. tcx ( ) . sess . has_errors ( ) { // regionck assumes typeck succeeded
151
+ let v = regionck_visitor ( ) ;
152
+ ( v. visit_block ) ( blk, rcx, v) ;
153
+ }
150
154
fcx. infcx ( ) . resolve_regions ( ) ;
151
155
}
152
156
You can’t perform that action at this time.
0 commit comments