@@ -158,7 +158,6 @@ macro_rules! ignore_err(
158
158
159
159
pub struct Rcx < ' a > {
160
160
fcx : & ' a FnCtxt < ' a > ,
161
- errors_reported : uint ,
162
161
163
162
// id of innermost fn or loop
164
163
repeating_scope : ast:: NodeId ,
@@ -294,8 +293,7 @@ impl<'a, 'b> mc::Typer for &'a mut Rcx<'b> {
294
293
}
295
294
296
295
pub fn regionck_expr ( fcx : & FnCtxt , e : & ast:: Expr ) {
297
- let mut rcx = Rcx { fcx : fcx, errors_reported : 0 ,
298
- repeating_scope : e. id } ;
296
+ let mut rcx = Rcx { fcx : fcx, repeating_scope : e. id } ;
299
297
let rcx = & mut rcx;
300
298
if fcx. err_count_since_creation ( ) == 0 {
301
299
// regionck assumes typeck succeeded
@@ -305,8 +303,7 @@ pub fn regionck_expr(fcx: &FnCtxt, e: &ast::Expr) {
305
303
}
306
304
307
305
pub fn regionck_fn ( fcx : & FnCtxt , blk : & ast:: Block ) {
308
- let mut rcx = Rcx { fcx : fcx, errors_reported : 0 ,
309
- repeating_scope : blk. id } ;
306
+ let mut rcx = Rcx { fcx : fcx, repeating_scope : blk. id } ;
310
307
let rcx = & mut rcx;
311
308
if fcx. err_count_since_creation ( ) == 0 {
312
309
// regionck assumes typeck succeeded
@@ -951,8 +948,7 @@ fn constrain_regions_in_type_of_node(
951
948
rcx : & mut Rcx ,
952
949
id : ast:: NodeId ,
953
950
minimum_lifetime : ty:: Region ,
954
- origin : infer:: SubregionOrigin ) -> bool
955
- {
951
+ origin : infer:: SubregionOrigin ) {
956
952
//! Guarantees that any lifetimes which appear in the type of
957
953
//! the node `id` (after applying adjustments) are valid for at
958
954
//! least `minimum_lifetime`
@@ -970,15 +966,14 @@ fn constrain_regions_in_type_of_node(
970
966
ty={}, ty0={}, id={}, minimum_lifetime={:?})",
971
967
ty_to_str( tcx, ty) , ty_to_str( tcx, ty0) ,
972
968
id, minimum_lifetime) ;
973
- constrain_regions_in_type ( rcx, minimum_lifetime, origin, ty)
969
+ constrain_regions_in_type ( rcx, minimum_lifetime, origin, ty) ;
974
970
}
975
971
976
972
fn constrain_regions_in_type (
977
973
rcx : & mut Rcx ,
978
974
minimum_lifetime : ty:: Region ,
979
975
origin : infer:: SubregionOrigin ,
980
- ty : ty:: t ) -> bool
981
- {
976
+ ty : ty:: t ) {
982
977
/*!
983
978
* Requires that any regions which appear in `ty` must be
984
979
* superregions of `minimum_lifetime`. Also enforces the constraint
@@ -993,7 +988,6 @@ fn constrain_regions_in_type(
993
988
* code that R corresponds to."
994
989
*/
995
990
996
- let e = rcx. errors_reported ;
997
991
let tcx = rcx. fcx . ccx . tcx ;
998
992
999
993
debug ! ( "constrain_regions_in_type(minimum_lifetime={}, ty={})" ,
@@ -1020,8 +1014,6 @@ fn constrain_regions_in_type(
1020
1014
r_sub, r_sup) ;
1021
1015
}
1022
1016
} ) ;
1023
-
1024
- return e == rcx. errors_reported ;
1025
1017
}
1026
1018
1027
1019
fn link_addr_of ( rcx : & mut Rcx , expr : & ast:: Expr ,
0 commit comments