Skip to content

Commit

Permalink
item_impl holds an Option<> to the trait ref, not a list of trait ref…
Browse files Browse the repository at this point in the history
…s. Therefore, we should not iterate over it.
  • Loading branch information
nrc committed Jan 10, 2014
1 parent 28ddc65 commit 40d8a12
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/libsyntax/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,13 @@ pub fn walk_item<E: Clone, V: Visitor<E>>(visitor: &mut V, item: &Item, env: E)
walk_enum_def(visitor, enum_definition, type_parameters, env)
}
ItemImpl(ref type_parameters,
ref trait_references,
typ,
ref methods) => {
ref trait_reference,
typ,
ref methods) => {
visitor.visit_generics(type_parameters, env.clone());
for trait_reference in trait_references.iter() {
walk_trait_ref(visitor, trait_reference, env.clone())
match *trait_reference {
Some(ref trait_reference) => walk_trait_ref(visitor, trait_reference, env.clone()),
None => ()
}
visitor.visit_ty(typ, env.clone());
for method in methods.iter() {
Expand Down

1 comment on commit 40d8a12

@alexcrichton
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

Please sign in to comment.