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

5 comments on commit 40d8a12

@bors
Copy link
Contributor

@bors bors commented on 40d8a12 Jan 11, 2014

Choose a reason for hiding this comment

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

saw approval from alexcrichton
at nrc@40d8a12

@bors
Copy link
Contributor

@bors bors commented on 40d8a12 Jan 11, 2014

Choose a reason for hiding this comment

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

merging nick29581/rust/visit_trait_option = 40d8a12 into auto

@bors
Copy link
Contributor

@bors bors commented on 40d8a12 Jan 11, 2014

Choose a reason for hiding this comment

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

nick29581/rust/visit_trait_option = 40d8a12 merged ok, testing candidate = 5a6ca45

@bors
Copy link
Contributor

@bors bors commented on 40d8a12 Jan 11, 2014

Choose a reason for hiding this comment

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

@bors
Copy link
Contributor

@bors bors commented on 40d8a12 Jan 11, 2014

Choose a reason for hiding this comment

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

fast-forwarding master to auto = 5a6ca45

Please sign in to comment.