-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: introduce path_to_local_with_projections
#15396
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
Conversation
4c1f627
to
f4deea5
Compare
Won't those changes make |
Yes, but the no-longer-unfixable test case does pretty much that -- it checks that the suggestion goes through a field (in this case, tuple element) projection. I tried modifying the test case to test indexing projection as well: let v = vec![S("four"), S("five"), S("six")];
- let v = (DropDeIterator(v.into_iter()), 42);
+ let v = [(DropDeIterator(v.into_iter()), 42)];
- println!("Last element is {}", v.0.last().unwrap().0);
+ println!("Last element is {}", v[0].0.last().unwrap().0);
//~^ ERROR: called `Iterator::last` on a `DoubleEndedIterator` But that broke because one can't move out of an array by indexing, which
I think not, because the function that the lint used previously is identical to the new |
80d3c1f
to
d93599f
Compare
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.
Looks good to me, I agree that the tests are sufficient. In eager_transmute
/filter_next
there's no behavioral change since it's the same function just factored out and double_ended_iterator_last
indeed already has a test that exercises this change, like you said 👍
Could you squash?
combine two similar arms use in `eager_transmute` use in `double_ended_iterator_last` use different numbers in the new test case to avoid possible confusion move the other "unfixable" case as well; it shouldn't lint anyway, so having it in the main test file is fine
d93599f
to
04606e2
Compare
path_to_local_with_projections
path_to_local_with_projections
squashed (and rebased) |
As suggested in #15268 (comment)
WIP because:
tests/ui/double_ended_iterator_last_unfixable.rs
?double_ended_iterator_last
okay in general?.last()
to.next_back()
requires a mutable receiver #14140changelog: none
r? @y21