Skip to content

Add inverse hyperbolic functions and add ldexp and frexp functions - #6463

Closed
brendanzab wants to merge 3 commits into
rust-lang:incomingfrom
brendanzab:numeric-traits
Closed

Add inverse hyperbolic functions and add ldexp and frexp functions#6463
brendanzab wants to merge 3 commits into
rust-lang:incomingfrom
brendanzab:numeric-traits

Conversation

@brendanzab

Copy link
Copy Markdown
Contributor

This is part of the numeric trait reform tracked on issue #4819

bors added a commit that referenced this pull request May 14, 2013
This is part of the numeric trait reform tracked on issue #4819
@borsbors closed this May 14, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 25, 2021
Teach SpanlessEq binding IDs
changelog: Fix collapsible_match false positive
Fixesrust-lang#6740
This PR changes the way `SpanlessEq` determines whether two local variables are the same. Instead of checking that the names match, it checks that the `HirId`s match. If local bindings are declared within the expressions that are being compared, `SpanlessEq` will remember bindings that correspond to each other in a `FxHashMap<HirId, HirId>`. This makes `SpanlessEq` more flexible while also fixing false positives.
Example: `{ let x = 1; x + 2 }` is equal to `{ let y = 1; y + 2 }`.
CC `@xFrednet` I think this will resolve some concerns in rust-lang#6463
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 8, 2021
…, r=phansch
New Lint: `branches_sharing_code`
This lint checks if all `if`-blocks contain some statements that are the same and can be moved out of the blocks to prevent code duplication. Here is an example:
```rust
let _ = if ... {
println!("Start"); // <-- Lint for code duplication
let _a = 99;
println!("End"); // <-- Lint for code duplication
false
} else {
println!("Start");
let _b = 17;
println!("End");
false
};
```
This could be written as:
```rust
println!("Start");
let _ = if ... {
let _a = 99;
false
} else {
let _b = 17;
false
};
println!("End");
```
---
This lint will get masked by the `IF_SAME_THEN_ELSE` lint. I think it makes more sense to only emit one lint per if block. This means that the folloing example:
```rust
if ... {
let _a = 17;
} else {
let _a = 17;
}
```
Will only trigger the `IF_SAME_THEN_ELSE` lint and not the `SHARED_CODE_IN_IF_BLOCKS` lint.
---
closes: rust-lang#5234
changelog: Added a new lint: `branches_sharing_code`
And hello to the one that is writing the changelog for this release :D
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
6932: Added a warning if conflicting rust-lang.rust is enabled. r=lnicola a=extremegf
Added a warning if conflicting rust-lang.rust plugin is enabled.
Resolvesrust-lang#6463
![Screenshot from 2020-12-18 18-33-02](https://user-images.githubusercontent.com/1788593/102644202-b2f50500-4160-11eb-8fb0-76aeebd80aea.png)
Co-authored-by: Przemyslaw Horban <p.horban@invinets.com>
Sign up for freeto 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

@brendanzab@thestinger@bors