@@ -311,13 +311,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
311
311
312
312
// Walk backwards up the ribs in scope.
313
313
let mut module = self . graph_root ;
314
- for i in ( 0 .. ribs. len ( ) ) . rev ( ) {
315
- debug ! ( "walk rib\n {:?}" , ribs [ i ] . bindings) ;
314
+ for ( i , rib ) in ribs. iter ( ) . enumerate ( ) . rev ( ) {
315
+ debug ! ( "walk rib\n {:?}" , rib . bindings) ;
316
316
// Use the rib kind to determine whether we are resolving parameters
317
317
// (macro 2.0 hygiene) or local variables (`macro_rules` hygiene).
318
- let rib_ident = if ribs[ i] . kind . contains_params ( ) { normalized_ident } else { ident } ;
319
- if let Some ( ( original_rib_ident_def, res) ) = ribs[ i] . bindings . get_key_value ( & rib_ident)
320
- {
318
+ let rib_ident = if rib. kind . contains_params ( ) { normalized_ident } else { ident } ;
319
+ if let Some ( ( original_rib_ident_def, res) ) = rib. bindings . get_key_value ( & rib_ident) {
321
320
// The ident resolves to a type parameter or local variable.
322
321
return Some ( LexicalScopeBinding :: Res ( self . validate_res_from_ribs (
323
322
i,
@@ -329,7 +328,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
329
328
) ) ) ;
330
329
}
331
330
332
- module = match ribs [ i ] . kind {
331
+ module = match rib . kind {
333
332
RibKind :: Module ( module) => module,
334
333
RibKind :: MacroDefinition ( def) if def == self . macro_def ( ident. span . ctxt ( ) ) => {
335
334
// If an invocation of this macro created `ident`, give up on `ident`
0 commit comments