Commit Graph

2899 Commits

Author SHA1 Message Date
JarredAllen
c3e96d14ab Update test case answers to match cargo dev fmt 2020-03-03 19:23:04 -08:00
JarredAllen
fe342f3291 Ran cargo dev fmt 2020-03-03 18:06:59 -08:00
JarredAllen
f8e949fa1c Recommended changes from flip1995 2020-03-03 15:52:53 -08:00
JarredAllen
ee73972537 Changed test output to reflect cargo fmt 2020-02-29 19:11:38 -08:00
JarredAllen
bfa2691559 Run cargo dev fmt 2020-02-29 18:51:39 -08:00
JarredAllen
028cddb956 Finished checking for cases of absolute values 2020-02-29 13:46:59 -08:00
JarredAllen
5a21661ce5 Some bugfixing 2020-02-28 12:40:13 -08:00
JarredAllen
ce0dc9b70e Created floating point abs lint and test, but not yet run 2020-02-27 22:31:41 -08:00
Yuki Okushi
7c760e5f83 Rustup to rust-lang/rust#61812 2020-02-27 12:19:18 +09:00
Krishna Sai Veera Reddy
ff0d44e45a Add imprecise_flops lint
Add lint to detect floating point operations that can be computed more
accurately at the cost of performance. `cbrt`, `ln_1p` and `exp_m1`
library functions call their equivalent cmath implementations which is
slower but more accurate so moving checks for these under this new lint.
2020-02-23 22:36:15 -08:00
Krishna Sai Veera Reddy
e94a167508 Rename mul_add test file and add general improvements 2020-02-23 22:20:34 -08:00
Krishna Sai Veera Reddy
4065ca9c8c Move manual_mul_add into suboptimal_flops lint 2020-02-23 22:20:34 -08:00
Krishna Sai Veera Reddy
454e505c12 Run rust-fix on tests 2020-02-23 22:20:34 -08:00
Krishna Sai Veera Reddy
6dacb1aa67 Change lint name to suboptimal_flops 2020-02-23 22:20:34 -08:00
Krishna Sai Veera Reddy
bc03f465c3 Remove lint for logarithm division identity 2020-02-23 22:20:34 -08:00
Krishna Veera Reddy
fd2506bcbf Add type suffixes to unsuffixed method receiver suggestions 2020-02-23 22:20:34 -08:00
Krishna Veera Reddy
de07c84903 Detect usage of (x + 1).ln() and suggest x.ln_1p() instead 2020-02-23 22:20:34 -08:00
Krishna Veera Reddy
a60ae5d31c Split test cases into separate files 2020-02-23 22:20:34 -08:00
Krishna Veera Reddy
de79733924 Lint expressions of the form x.log(b) / y.log(b) 2020-02-23 22:20:33 -08:00
Krishna Veera Reddy
9520d3dfa4 Suggest usage of powi method when applicable 2020-02-23 22:20:33 -08:00
Krishna Veera Reddy
1f4f357bf5 Consolidate the accuracy and efficiency lints
Merge the accuracy and efficiency lints into a single lint that
checks for improvements to accuracy, efficiency and readability
of floating-point expressions.
2020-02-23 22:20:33 -08:00
Krishna Veera Reddy
c636c6a55b Add lints to detect inaccurate and inefficient FP operations
Add lints to detect floating point computations that are either
inaccurate or inefficient and suggest better alternatives.
2020-02-23 22:20:33 -08:00
Krishna Sai Veera Reddy
049079856b Prevent missing_const_for_fn on functions with const generic params
`const` functions cannot have const generic parameters so prevent the
`missing_const_for_fn` lint from firing in that case.
2020-02-21 19:56:44 -08:00
flip1995
4dd2252b17
Fix suggestion for weird formattings 2020-02-21 11:14:19 +01:00
flip1995
b67764d5cb
Add test for prelude import 2020-02-21 11:14:18 +01:00
flip1995
06a6189376
Move enum_glob_use lint into wildcard_imports pass 2020-02-21 11:14:17 +01:00
flip1995
8a572a540a
Add tests for wildcard_imports lint 2020-02-21 11:02:25 +01:00
bors
acfcbee4a2 Auto merge of #5202 - krishna-veerareddy:issue-5201-move-lossy-float-literal-restriction, r=flip1995
Move check for lossy whole-number floats out of `excessive_precision`

changelog: Add new lint `lossy_float_literal` to detect lossy whole number float literals and move it out of `excessive_precision` again.

Fixes #5201
2020-02-21 09:43:55 +00:00
Yuki Okushi
8abe4365f3 Use generator own DefId 2020-02-21 16:24:58 +09:00
Krishna Sai Veera Reddy
219c94d028 Separate out lint to check lossy whole number float literals 2020-02-20 22:33:36 -08:00
Matthias Krüger
4f85bc2fe9 rustup https://github.com/rust-lang/rust/pull/69325, update test stderr 2020-02-20 23:54:10 +01:00
flip1995
fb989d3215
Remove remaining license header in test file 2020-02-20 12:06:45 +01:00
Krishna Sai Veera Reddy
533422fcce Add LOG2_10 and LOG10_2 to approx_const lint 2020-02-18 08:05:00 -08:00
daxpedda
0ee393cf01
Add tests and improve checks. 2020-02-17 14:43:38 +01:00
Krishna Sai Veera Reddy
552452873c Add tests for lossy whole number float literals 2020-02-17 00:05:50 -08:00
Yuki Okushi
09165ff576 Don't lint single_component_path_imports in macros 2020-02-17 11:13:42 +09:00
Yuki Okushi
f77158bc14 Fix false positive in zero_prefixed_literal 2020-02-13 14:39:29 +09:00
flip1995
b47dada167
Apply review comments 2020-02-12 09:34:28 +01:00
flip1995
095287dbc8
Add two more error causes to integration test 2020-02-12 09:34:27 +01:00
flip1995
1717a6f7d5
Ignore fmt test in GHA CI
This is already checked by clippy_dev.yml GHA
2020-02-12 09:34:26 +01:00
Krishna Sai Veera Reddy
fcc3e7238f Remove unnecessary imports from tests 2020-02-11 06:20:47 -08:00
Philipp Krones
c86c09b19a
Use current_dir instead of cargo_metadata
Co-Authored-By: lzutao <taolzu@gmail.com>
2020-02-10 16:42:50 +01:00
flip1995
f940b04de6
Fix run-pass tests when CARGO_TARGET_DIR is not set 2020-02-10 15:51:51 +01:00
bors
c066807a70 Auto merge of #5148 - krishna-veerareddy:issue-5147-option-env-unwrap, r=flip1995
Add `option-env-unwrap` lint

changelog: Add `option-env-unwrap` lint

Fixes #5147
2020-02-10 08:08:53 +00:00
Krishna Sai Veera Reddy
b48b221f80 Use PATH environment variable for testing
The tests were failing on windows because the `HOME` env variable
doesn't exist on it so using the `PATH` variable to test instead.
2020-02-09 15:35:51 -08:00
Krishna Sai Veera Reddy
a3a1587a1c Allow option-env-unwrap within external macros 2020-02-09 10:58:08 -08:00
Krishna Sai Veera Reddy
0e5ba2f0e7 Account for expect being used to unwrap Option 2020-02-09 08:54:23 -08:00
Lzu Tao
9eb913a7e2 Fix error E0460 when compiled on Rustc repo 2020-02-09 19:02:27 +07:00
Krishna Sai Veera Reddy
be1bc571c3 Add option-env-unwrap lint 2020-02-08 16:44:35 -08:00
Lzu Tao
9a12baad35 Update CARGO_TARGET_DIR 2020-02-07 14:41:04 +07:00