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

Manual: proto! is gone #10901

Closed
wants to merge 1 commit into from
Closed

Manual: proto! is gone #10901

wants to merge 1 commit into from

Conversation

kud1ing
Copy link

@kud1ing kud1ing commented Dec 10, 2013

The following files need to be adjusted, too (i can't do it now):

  • doc/po/ja/rust.md.po
  • doc/po/rust.md.pot

The following files need to be adjusted, too (i can't do it now):
- doc/po/ja/rust.md.po
- doc/po/rust.md.pot
@adrientetar
Copy link
Contributor

The japanese translation has been left unmaintained since it's been PR'ed iirc.

@emberian emberian closed this Dec 11, 2013
@kud1ing kud1ing deleted the patch-1 branch December 13, 2013 22:14
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 30, 2023
…h,Centri3

[`useless_vec`]: lint `vec!` invocations when a slice or an array would do

First off, sorry for that large diff in tests. *A lot* of tests seem to trigger the lint with this new change, so I decided to `#![allow()]` the lint in the affected tests to make reviewing this easier, and also split the commits up so that the first commit is the actual logic of the lint and the second commit contains all the test changes. The stuff that changed in the tests is mostly just line numbers now. So, as large as the diff looks, it's not actually that bad. 😅
I manually went through all of these to find out about edge cases and decided to put them in `tests/ui/vec.rs`.

For more context, I wrote about the idea of this PR here: rust-lang/rust-clippy#2262 (comment) (that explains the logic)

Basically, it now also considers the case where a `Vec` is put in a local variable and the user only ever does things with it that one could also do with a slice or an array. This should catch a lot more cases, and (at least from looking at the tests) it does.

changelog: [`useless_vec`]: lint `vec!` invocations when a slice or an array would do (also considering local variables now)
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 30, 2023
[`useless_vec`]: lint on `vec![_]` invocations that adjust to a slice

Fixes rust-lang#2262 (well, actually my PR over at rust-lang#10901 did do most of the stuff, but this PR implements the one last other case mentioned in the comments that my PR didn't fix)

Before this change, it would lint `(&vec![1]).iter().sum::<i32>()`, but not `vec![1].iter().sum::<i32>()`. This PR handles this case.
This also refactors a few things that I wanted to do in my other PR but forgot about.

changelog: [`useless_vec`]: lint on `vec![_]` invocations that adjust to a slice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants