Auto merge of #314 - fitzgen:assert-no-infinite-loops-in-ancestors, r=emilio
Auto merge of #314 - fitzgen:assert-no-infinite-loops-in-ancestors, r=emilio

Assert that we won't infinite loop

In non-release builds with debug assertions, keep track of the set of
`ItemId`s that we have iterated over in `ItemAncestorsIter` and make
sure that we don't reach an ancestor we have already yielded, which
would trigger an infinite loop.

rust-lang/rust-bindgen,rust-lang/rust-bindgen,rust-lang/rust-bindgen,emilio/rust-bindgen,emilio/rust-bindgen,emilio/rust-bindgen,emilio/rust-bindgen,rust-lang/rust-bindgen,emilio/rust-bindgen