Commit Graph

7935 Commits

Author SHA1 Message Date
Jacek Pospychala
697e3c89a7 Improve placeholder in map_unit_fn 2020-03-09 20:37:06 +01:00
bors
d8f64b6eba Auto merge of #5287 - matthiaskrgr:pat_isref, r=flip1995
redundant_pattern: take binding (ref, ref mut) into account in suggestion

fixes #5271

changelog: redundant_pattern: take binding (ref, ref mut) into account in suggestion (#5271)
2020-03-09 17:25:09 +00:00
bors
92e25bb7e1 Auto merge of #5286 - matthiaskrgr:delay_vec_creation, r=flip1995
check_pat: delay creation of the "normal" vec until we reach the branch where it is actually needed

changelog: none
2020-03-09 17:09:38 +00:00
bors
118594ffa2 Auto merge of #5291 - ThibsG:FixSingleBinding, r=flip1995
Fix match single binding when in a let stmt

Fix bad suggestion when `match_single_binding` lints when inside a local (let) statement.

Fixes #5267

changelog: none
2020-03-09 16:04:26 +00:00
ThibsG
40a04f2657 Fix match single binding when in a let stmt 2020-03-09 16:59:24 +01:00
bors
a5477c500c Auto merge of #5285 - matthiaskrgr:dep_it, r=flip1995
deps: bump itertools 0.8 -> 0.9

changelog: none
2020-03-09 14:29:40 +00:00
bors
c7b395fdf9 Auto merge of #5290 - polybuildr:map-message, r=phansch
Improve error messages for {option,result}_map_unit_fn

Instead of saying "unit function", use the phrase the description uses: "function that returns the unit type".

Fixes #5180.

changelog: Improve error messages for {option,result}_map_unit_fn
2020-03-09 13:11:23 +00:00
bors
bc51a1a1e9 Auto merge of #5289 - polybuildr:setup, r=matthiaskrgr
Mention the setup instructions in CONTRIBUTING

Multiple people seem to have missed this based on questions asked in the Discord channel. Might as well mention it up front.

changelog: none
2020-03-08 22:24:26 +00:00
Vivek Ghaisas
ab6e709ee6 Improve error messages for {option,result}_map_unit_fn
Instead of saying "unit function", use the phrase the description
uses: "function that returns the unit type".

Fixes #5180.
2020-03-08 21:28:06 +00:00
Vivek Ghaisas
3b3e5ea2a2 Mention the setup instructions in CONTRIBUTING
Multiple people seem to have missed this based on questions asked in the
Discord channel. Might as well mention it up front.
2020-03-08 21:07:18 +00:00
Matthias Krüger
75a2300e27 redundant_pattern: take binding (ref, ref mut) into account in suggestion.
fixes #5271
2020-03-08 10:47:18 +01:00
Matthias Krüger
a412b3423e check_pat: delay creation of the "normal" vec until we reach the branch where is is actually needed 2020-03-08 02:50:33 +01:00
Matthias Krüger
806699342e deps: bump itertools 0.8 -> 0.9
changelog: none
2020-03-08 01:33:17 +01:00
bors
3d0f0e33af Auto merge of #5276 - flip1995:macro_use, r=flip1995
Rename macro_use_import -> macro_use_imports

I missed this during review of #5230. We can just do this, without deprecating the old name, since this lint didn't hit nightly rustc yet.

changelog: none
2020-03-05 18:25:07 +00:00
flip1995
57393b5106
Rename macro_use_import -> macro_use_imports 2020-03-05 19:22:17 +01:00
bors
23d2b21297 Auto merge of #5230 - DevinR528:macro-use, r=flip1995
Macro use

---

changelog: This lint enforces Rust 2018 idiom of importing macro's directly without `#[macro_use]` fixes #5179 .
2020-03-05 17:30:52 +00:00
bors
ac2e10a29a Auto merge of #5235 - flip1995:tag_deploy_fix, r=phansch
Fix deploy script for tag deploys

By hand updating the documentation for the `rust-1.41.1` release, I found, that the deploy script was buggy for tag deploys. Luckily we weren't affected yet (will only run if the commit of the tag already has the workflow config, so probably ~`rust-1.43.0`)

The bug:

When a tag was deployed, until now it also updated the master documentation to the state of the tag. This was because the `git add .` not only updated the files created or modified by the tag commit, but also the master lints.json file.

changelog: none
2020-03-05 17:17:14 +00:00
bors
329923edec Auto merge of #5257 - mlegner:cast_hex_fp, r=flip1995
Resolve false positives of unnecessary_cast for non-decimal integers

This PR resolves false positives of `unnecessary_cast` for hexadecimal integers to floats and adds a corresponding test case.

Fixes: #5220

changelog: none
2020-03-04 16:11:40 +00:00
Devin R
597e02dcdf warn on macro_use attr 2020-03-04 09:36:02 -05:00
bors
8c7b3ad3fa Auto merge of #5266 - sinkuu:questionmark, r=flip1995
Lint `if let Some` and early return in question_mark lint

Fixes #5260

changelog: lint `if let Some` and early return in `question_mark` lint
2020-03-04 13:30:08 +00:00
Shotaro Yamada
a78a1fc97b Apply suggestions from code review
Co-Authored-By: Philipp Krones <hello@philkrones.com>
2020-03-04 22:08:50 +09:00
mlegner
185fa0d1b1
Simplify if_chain. 2020-03-04 13:22:54 +01:00
mlegner
d14fdc0203
Move NumericLiteral to its own module. 2020-03-04 13:22:53 +01:00
mlegner
73deb723dd
Included binary and octal cases. 2020-03-04 13:21:01 +01:00
mlegner
6673cc8329
Resolve false positives for hex int cast. 2020-03-04 13:21:00 +01:00
mlegner
9ff4581cd3
Test for unnecessary_cast of hex int literal. 2020-03-04 13:21:00 +01:00
bors
36b65986af Auto merge of #5258 - ThibsG:UselessBindingInStruct638, r=flip1995
Add lint for .. use in fully binded struct

This PR adds the lint `match-wild-in-fully-binded-struct` to prevent the use of the `..` pattern when all fields of the struct are already binded.

Fixes: #638

changelog: Add [`rest_pat_in_fully_bound_structs`] lint to warn against the use of `..` in fully binded struct
2020-03-04 11:06:31 +00:00
bors
8dc3fde127 Auto merge of #5246 - JarredAllen:master, r=flip1995
Detect usage of custom floating-point abs implementation

Closes #5224

changelog: Enhance [`suboptimal_flops`] lint to detect manual implementations of the `abs` method
2020-03-04 10:53:03 +00:00
Shotaro Yamada
246709f89e run-rustfix 2020-03-04 17:37:01 +09:00
Shotaro Yamada
45f61ead2c Lint if let Some in question_mark lint 2020-03-04 17:24:12 +09:00
ThibsG
2aa14c9beb Add restrictive pat use in full binded struct 2020-03-04 09:11:07 +01:00
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
bors
74eae9dc60 Auto merge of #5264 - flip1995:rustup, r=flip1995
Rustup to rust-lang/rust#69506

changelog: none
2020-03-04 00:06:25 +00:00
flip1995
a640696cdf
Rustup to rust-lang/rust#69506 2020-03-04 00:56:43 +01:00
JarredAllen
f8e949fa1c Recommended changes from flip1995 2020-03-03 15:52:53 -08:00
bors
9c93f04c90 Auto merge of #5262 - JohnTitor:rls, r=flip1995
Revive rls integration test

RLS updated their dependencies in rust-lang/rls#1646 so we can revive the integration test. I confirm it passed on my local.

changelog: none
2020-03-03 20:13:19 +00:00
Yuki Okushi
e633ea823c Revive rls integration test 2020-03-04 04:32:42 +09:00
bors
e4d688c10a Auto merge of #5261 - matthiaskrgr:qmark, r=flip1995
use question mark operator

changelog: none
2020-03-03 14:41:20 +00:00
Matthias Krüger
94867fbbb8 use question mark operator 2020-03-03 15:13:25 +01:00
bors
d74229b97d Auto merge of #5256 - JohnTitor:try-eval-usize, r=phansch
Use `try_eval_usize` over `eval_usize`

Fixes #5223

changelog: Fix ICE in evaluating usizes
2020-03-03 13:38:42 +00:00
Yuki Okushi
46ee6b1840 Add regression test 2020-03-03 22:22:46 +09:00
Yuki Okushi
3d44ad2e32 Use try_eval_usize over eval_usize 2020-03-03 21:40:24 +09:00
bors
b96c3ca811 Auto merge of #5259 - flip1995:lang_items, r=phansch
Use lang items instead of get_trait_def_id where possible

changelog: none
2020-03-03 11:46:21 +00:00
bors
f44181e799 Auto merge of #5047 - flip1995:use_debug, r=phansch
Don't trigger use_debug lint in Debug impl

Fixes #5039

changelog: Don't trigger [`use_debug`] lint in Debug impl
2020-03-03 11:32:51 +00:00
bors
5d3e3e1a9e Auto merge of #5250 - mlegner:unused_fp, r=flip1995
Whitelist unused attribute for use items.

This PR whitelists the `unused` attribute with `use` items and adds a corresponding test case.

Fixes: #5229
changelog: none
2020-03-03 11:16:55 +00:00
flip1995
91042db2e8
Add path for display trait 2020-03-03 10:54:30 +01:00
flip1995
58cea334ec
Use lang items instead of get_trait_def_id where possible 2020-03-03 10:54:30 +01:00
flip1995
a540b5ca2e
Update stderr 2020-03-03 10:48:08 +01:00
flip1995
a628733ade
Don't lint debug formatting in debug impl 2020-03-03 10:48:08 +01:00