-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[map_identity
]: respect match ergonomics
#11792
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r? @llogiq (rustbot has picked a reviewer for you, use r? to override) |
rustbot
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties
label
Nov 11, 2023
Thank you, that's a solid improvement! @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
primeos-work
added a commit
to primeos-work/butido
that referenced
this pull request
Nov 16, 2023
This got detected and "fixed" (improved) by clippy's `get_first` [0] lint (beta toolchain version 1.75.0-beta.1). Clippy currently shows two more warnings from the `map_identity` [1] lint but those are false positives and a fix was already merged [2]. [0]: https://rust-lang.github.io/rust-clippy/master/index.html#/get_first [1]: https://rust-lang.github.io/rust-clippy/master/index.html#/map_identity [2]: rust-lang/rust-clippy#11792 Signed-off-by: Michael Weiss <michael.weiss@atos.net>
primeos-work
added a commit
to primeos-work/butido
that referenced
this pull request
Nov 16, 2023
This got detected and "fixed" (improved) by clippy's `get_first` [0] lint (beta toolchain version 1.75.0-beta.1). Clippy currently shows two more warnings from the `map_identity` [1] lint but those are false positives and a fix was already merged [2]. [0]: https://rust-lang.github.io/rust-clippy/master/index.html#/get_first [1]: https://rust-lang.github.io/rust-clippy/master/index.html#/map_identity [2]: rust-lang/rust-clippy#11792 Signed-off-by: Michael Weiss <michael.weiss@atos.net>
This was referenced Dec 29, 2023
Closed
zydou
pushed a commit
to zydou/arti
that referenced
this pull request
Jan 2, 2024
clippy in current stable thinks |(a, b)| (a, b) is always the identity function, but due to match ergonomics, it might be an implicit copy. This is fixed in nightly by rust-lang/rust-clippy#11792
facebook-github-bot
pushed a commit
to facebookexperimental/rust-shed
that referenced
this pull request
Jan 24, 2024
Summary: See rust-lang/rust-clippy#11792 map_identity is causing build failures by taking its suggestion. Once the fix is in, we can revert the changes to tools/buckconfigs/fbsource-common.bcfg in this diff. Reviewed By: zertosh Differential Revision: D53018763 fbshipit-source-id: a393dd9888a1320c19fc10de4b4c1e5d9b15bd43
ammernico
pushed a commit
to ammernico/butido
that referenced
this pull request
Apr 30, 2024
This got detected and "fixed" (improved) by clippy's `get_first` [0] lint (beta toolchain version 1.75.0-beta.1). Clippy currently shows two more warnings from the `map_identity` [1] lint but those are false positives and a fix was already merged [2]. [0]: https://rust-lang.github.io/rust-clippy/master/index.html#/get_first [1]: https://rust-lang.github.io/rust-clippy/master/index.html#/map_identity [2]: rust-lang/rust-clippy#11792 Signed-off-by: Michael Weiss <michael.weiss@atos.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #11764
Note: the original tests before this were slightly wrong themselves already and had to be changed. They were calling
map
on an iterator of&(i32, i32)
s, so this PR would stop linting there, but they were meant to test something else unrelated to binding modes, so I just changed them to remove the references so that it iterates over owned values and they all bind by value. This way they continue to test what they checked for before: the identity function for tuple patterns.changelog: [
map_identity
]: respect match ergonomics