-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error when updating rustc #147
Comments
This looks like a rust bug that should be reported upstream. |
Reported upstream: rust-lang/rust#61549 |
bors-servo
pushed a commit
that referenced
this issue
Jun 8, 2019
Fix `extend` from assuming a fused iterator. Iterators may resume after returning None. I think it is generally expected that `extend` should stop on the first None. Fixes #147. Specifically, in rustc, there are some situations where an iterator of Results are collected into a `Result<SmallVec, _>` (such as [here](https://github.com/rust-lang/rust/blob/c1c60d292e2dd2deff7084208274f9a02f750d43/src/librustc/ty/relate.rs#L139-L142) which ends up in [this call to `collect`](https://github.com/rust-lang/rust/blob/c1c60d292e2dd2deff7084208274f9a02f750d43/src/librustc/ty/context.rs#L3002)). The [Result adapter](https://github.com/rust-lang/rust/blob/c1c60d292e2dd2deff7084208274f9a02f750d43/src/libcore/result.rs#L1245-L1258) returns None for the first `Err` in the sequence. However, it is possible for an iterator to have additional elements after the first Err. With this bug, SmallVec was falling through to the slow-path `for` loop, and resuming the iterator grabbing too many elements. I believe this was having some bad interactions with the type interner where the additional elements after the `Err` were getting processed (via a `map()`) and interned when they shouldn't be (or otherwise having some side effects from the `map`). <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/150) <!-- Reviewable:end -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to update rust-lang/rust to the latest smallvec (0.6.7 ➙ 0.6.9), and an running into an issue where rustc fails to compile:
I have narrowed down the change that breaks this to #137.
I don't know anything about smallvec and very little about rustc, so if anyone can help figure out what's wrong, I'd appreciate it. I'll keep digging a little, but it is unlikely that I'll be able to do more. This can be reproduced with
cargo update -p smallvec; ./x.py build
(on master, 021a5033098ff0e3f7126acc7ac35149d325f16d).backtrace
The text was updated successfully, but these errors were encountered: