Use inner iterator may_have_side_effect for Cloned#56538
Merged
bors merged 2 commits intorust-lang:masterfrom Dec 6, 2018
Merged
Use inner iterator may_have_side_effect for Cloned#56538bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
Contributor
|
(rust_highfive has picked a reviewer for you, use r? to override) |
bluss
reviewed
Dec 5, 2018
Contributor
Author
|
Oops, modified this in wrong place, let me fix that. |
Previous implementation wasn't correct, as an inner iterator could have had side effects.
Contributor
|
Playground snippet to show the bug, that it silences sideeffects in map. I think we want to fix this because we don't want our use of specialization to be user-visible or affect sideeffectfulness of iterations. |
Contributor
Author
|
I will try adding a test case for this bug when I get home. |
Contributor
|
@bors r+ rollup thanks! |
Collaborator
|
📌 Commit a964307 has been approved by |
emilyalbini
added a commit
to emilyalbini/rust
that referenced
this pull request
Dec 5, 2018
Use inner iterator may_have_side_effect for Cloned Previous implementation wasn't correct, as an inner iterator could have had side effects. Noticed by @bluss in rust-lang#56534.
emilyalbini
added a commit
to emilyalbini/rust
that referenced
this pull request
Dec 5, 2018
Use inner iterator may_have_side_effect for Cloned Previous implementation wasn't correct, as an inner iterator could have had side effects. Noticed by @bluss in rust-lang#56534.
bors
added a commit
that referenced
this pull request
Dec 5, 2018
Rollup of 15 pull requests Successful merges: - #51753 (Document `From` implementations) - #55563 (Improve no result found sentence in doc search) - #55987 (Add Weak.ptr_eq) - #56119 (Utilize `?` instead of `return None`.) - #56372 (Refer to the second borrow as the "second borrow" in E0501.rs) - #56388 (More MIR borrow check cleanup) - #56424 (Mention raw-ident syntax) - #56452 (Remove redundant clones) - #56456 (Handle existential types in dead code analysis) - #56466 (data_structures: remove tuple_slice) - #56476 (Fix invalid line number match) - #56497 (cleanup: remove static lifetimes from consts in libstd) - #56498 (Fix line numbers display) - #56523 (Added a bare-bones eslint config (removing jslint)) - #56538 (Use inner iterator may_have_side_effect for Cloned) Failed merges: r? @ghost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previous implementation wasn't correct, as an inner iterator could have had side effects. Noticed by @bluss in #56534.