Repository navigation
Refactor trans_call - #5445
Merged
bors merged 1 commit intoMar 20, 2013
Merged
Refactor trans_call#5445
Conversation
… environment, and return pointer
oli-obk
pushed a commit
to oli-obk/rust
that referenced
this pull request
May 2, 2020
Fixes issue rust-lang#4892. First contribution here 😊 ! Do not hesitate to correct me. This PR is related to issue rust-lang#4892 . # Summary ```rust -literal.method_call(args) ``` The main idea is to not trigger `clippy::precedence` when the method call is an odd function. # Example ```rust // should trigger lint let _ = -1.0_f64.abs() //precedence of method call abs() and neg ('-') is ambiguous // should not trigger lint let _ = -1.0_f64.sin() // sin is an odd function => -sin(x) = sin(-x) ``` # Theory Rust allows following literals: - char - string - integers - floats - byte - bool Only integers/floats implements the relevant `std::ops::Neg`. Following odd functions are implemented on i[8-128] and/or f[32-64]: - `asin` - `asinh` - `atan` - `atanh` - `cbrt` - `fract` - `round` - `signum` - `sin` - `sinh` - `tan` - `tanh ` - `to_degrees` - `to_radians` # Implementation As suggested by `flip1995` in [comment](rust-lang/rust-clippy#4892 (comment)), this PR add a whitelist of odd functions and compare method call to the the whitelist before triggering lint. changelog: Don't trigger [`clippy::precedence`] on odd functions.
RalfJung
added a commit
to RalfJung/rust
that referenced
this pull request
Oct 24, 2026
…cos-check-shim-sig macOS shims: migrate to check_shim_sig
This file contains hidden or 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
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.
Refactor trans_call to separate out the translation of the arguments, environment, and return pointer. Towards #3678. r? @brson