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

Less bad copy throughout libsyntax/librustc #5443

Closed
wants to merge 2 commits into from

Conversation

alexcrichton
Copy link
Member

Removes a lot of instances of /*bad*/ copy throughout libsyntax/librustc. On the plus side, this shaves about 2s off of the runtime when compiling librustc with optimizations.

Ideally I would have run a profiler to figure out which copies are the most critical to remove, but in reality there was a liberal amount of git greps along with some spot checking and removing the easy ones.

@catamorphism
Copy link
Contributor

Wonderful, thanks!

bors added a commit that referenced this pull request Mar 20, 2013
Removes a lot of instances of `/*bad*/ copy` throughout libsyntax/librustc. On the plus side, this shaves about 2s off of the runtime when compiling `librustc` with optimizations.

Ideally I would have run a profiler to figure out which copies are the most critical to remove, but in reality there was a liberal amount of `git grep`s along with some spot checking and removing the easy ones.
@bors bors closed this Mar 20, 2013
flip1995 added a commit to flip1995/rust that referenced this pull request Jul 14, 2020
Some accuracy lints for floating point operations

This will add some lints for accuracy on floating point operations suggested by @clarfon in rust-lang#2040 (fixes rust-lang#2040).

These are the remaining lints:

- [x] x.powi(2) => x * x
- [x] x.logN() / y.logN() => x.logbase(y)
- [x] x.logbase(E) => x.log()
- [x] x.logbase(10) => x.log10()
- [x] x.logbase(2) => x.log2().
- [x] x * PI / 180 => x.to_radians()
- [x] x * 180 / PI => x.to_degrees()
- [x] (x + 1).log() => x.log_1p()
- [x] sqrt(x * x + y * y) => x.hypot(y)

changelog: Included some accuracy lints for floating point operations
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 14, 2020
Rollup of 5 pull requests

Successful merges:

 - rust-lang#5443 (Some accuracy lints for floating point operations)
 - rust-lang#5752 (Move range_minus_one to pedantic)
 - rust-lang#5756 (unnecessary_sort_by: avoid linting if key borrows)
 - rust-lang#5784 (Fix out of bounds access by checking length equality BEFORE accessing by index.)
 - rust-lang#5786 (fix phrase in new_lint issue template)

Failed merges:

r? @ghost

changelog: rollup
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