Skip to content
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

Suggest borrowing `Vec<NonCopy>` in for loop #68424

Merged
merged 2 commits into from Jan 24, 2020

Conversation

@estebank
Copy link
Contributor

estebank commented Jan 21, 2020

Partially address #64167.

Partially address #64167.
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 21, 2020

r? @davidtwco

(rust_highfive has picked a reviewer for you, use r? to override)

Copy link
Member

davidtwco left a comment

👍 LGTM, with @Centril's comments.

@estebank

This comment has been minimized.

Copy link
Contributor Author

estebank commented Jan 23, 2020

@bors r=davidtwco

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 23, 2020

📌 Commit 6eaf59d has been approved by davidtwco

tmandry added a commit to tmandry/rust that referenced this pull request Jan 24, 2020
…y-vec, r=davidtwco

Suggest borrowing `Vec<NonCopy>` in for loop

Partially address rust-lang#64167.
bors added a commit that referenced this pull request Jan 24, 2020
Rollup of 8 pull requests

Successful merges:

 - #68080 (Address inconsistency in using "is" with "declared here")
 - #68424 (Suggest borrowing `Vec<NonCopy>` in for loop)
 - #68438 (Account for non-types in substs for opaque type error messages)
 - #68469 (Avoid overflow in `std::iter::Skip::count`)
 - #68473 (Enable ASan on Fuchsia)
 - #68479 (Implement `unused_parens` for block return values)
 - #68483 (Add my (@flip1995) name to .mailmap)
 - #68500 (Clear out std, not std tools)

Failed merges:

r? @ghost
tmandry added a commit to tmandry/rust that referenced this pull request Jan 24, 2020
…y-vec, r=davidtwco

Suggest borrowing `Vec<NonCopy>` in for loop

Partially address rust-lang#64167.
bors added a commit that referenced this pull request Jan 24, 2020
Rollup of 7 pull requests

Successful merges:

 - #68424 (Suggest borrowing `Vec<NonCopy>` in for loop)
 - #68438 (Account for non-types in substs for opaque type error messages)
 - #68469 (Avoid overflow in `std::iter::Skip::count`)
 - #68473 (Enable ASan on Fuchsia)
 - #68479 (Implement `unused_parens` for block return values)
 - #68483 (Add my (@flip1995) name to .mailmap)
 - #68500 (Clear out std, not std tools)

Failed merges:

r? @ghost
let is_option = move_ty.starts_with("std::option::Option");
let is_result = move_ty.starts_with("std::result::Result");
let def_id = match move_place.ty(*self.body, self.infcx.tcx).ty.kind {
ty::Adt(self_def, _) => self_def.did,

This comment has been minimized.

Copy link
@oli-obk

oli-obk Jan 24, 2020

Contributor

Result, Vec and Option can't be anything but ty::Adt, so you can use ty_adt_def instead of manually matching on the TyKind variants

@bors bors merged commit 6eaf59d into rust-lang:master Jan 24, 2020
4 checks passed
4 checks passed
pr Build #20200123.53 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-7) Linux x86_64-gnu-llvm-7 succeeded
Details
pr (Linux x86_64-gnu-tools) Linux x86_64-gnu-tools succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.