Skip to content

Fix invalid suggestion on &mut iterators yielding & references - #70264

Merged
bors merged 1 commit into
rust-lang:masterfrom
tirr-c:issue-69789-mut-suggestion
Mar 24, 2020
Merged

Fix invalid suggestion on &mut iterators yielding & references#70264
bors merged 1 commit into
rust-lang:masterfrom
tirr-c:issue-69789-mut-suggestion

Conversation

@tirr-c

Copy link
Copy Markdown
Contributor

Fixes#69789.

rustc suggested an invalid code when & reference from &mut iterator is mutated. The compiler knew we're mutating a value behind & reference, but as the assignment RHS is from desugaring, it could only see the iterator expression from source and inserted mut there.

r? @estebank

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 22, 2020
@estebank

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Mar 23, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 1e5d81d has been approved by estebank

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 23, 2020
Centril added a commit to Centril/rust that referenced this pull request Mar 23, 2020
…r=estebank
Fix invalid suggestion on `&mut` iterators yielding `&` references
Fixesrust-lang#69789.
rustc suggested an invalid code when `&` reference from `&mut` iterator is mutated. The compiler knew we're mutating a value behind `&` reference, but as the assignment RHS is from desugaring, it could only see the iterator expression from source and inserted `mut` there.
r? @estebank
@CentrilCentril mentioned this pull request Mar 23, 2020
Centril added a commit to Centril/rust that referenced this pull request Mar 23, 2020
…r=estebank
Fix invalid suggestion on `&mut` iterators yielding `&` references
Fixesrust-lang#69789.
rustc suggested an invalid code when `&` reference from `&mut` iterator is mutated. The compiler knew we're mutating a value behind `&` reference, but as the assignment RHS is from desugaring, it could only see the iterator expression from source and inserted `mut` there.
r? @estebank
This was referenced Mar 23, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 24, 2020
Rollup of 11 pull requests
Successful merges:
- rust-lang#67761 (Move the dep_graph construction to a dedicated crate.)
- rust-lang#69740 (Replace some desc logic in librustc_lint with article_and_desc)
- rust-lang#69981 (Evaluate repeat expression lengths as late as possible)
- rust-lang#70087 (Remove const eval loop detector)
- rust-lang#70242 (Improve E0308 error message wording)
- rust-lang#70264 (Fix invalid suggestion on `&mut` iterators yielding `&` references)
- rust-lang#70267 (get rid of ConstPropUnsupported; use ZST marker structs instead)
- rust-lang#70277 (Remove `ReClosureBound`)
- rust-lang#70283 (Add regression test for rust-lang#70155.)
- rust-lang#70294 (Account for bad placeholder types in where clauses)
- rust-lang#70309 (Clean up E0452 explanation)
Failed merges:
r? @ghost
@bors
bors merged commit ab2817b into rust-lang:masterMar 24, 2020
@tirr-c
tirr-c deleted the issue-69789-mut-suggestion branch March 24, 2020 04:10
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compiler suggests "&mut mut"

4 participants

@tirr-c@estebank@bors@rust-highfive