-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Suggest borrowing Vec<NonCopy>
in for loop
#68424
Conversation
Partially address rust-lang#64167.
r? @davidtwco (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM, with @Centril's comments.
@bors r=davidtwco |
📌 Commit 6eaf59d has been approved by |
…y-vec, r=davidtwco Suggest borrowing `Vec<NonCopy>` in for loop Partially address rust-lang#64167.
…y-vec, r=davidtwco Suggest borrowing `Vec<NonCopy>` in for loop Partially address rust-lang#64167.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Partially address #64167.