Commit Graph

9699 Commits

Author SHA1 Message Date
rail
b541884294 remove the explicit return value of print_limit 2020-10-02 23:38:10 +13:00
rail
7820cb1442 Add tests for
* `dst.len()` as the end of the range with loop counters
* the increment of the loop counter at the top of the loop
2020-10-02 23:21:24 +13:00
Dániel Buga
45f25f82fe Run update_lints 2020-10-02 12:02:54 +02:00
Dániel Buga
515ca93123 Look for soft hyphens as well 2020-10-02 11:56:21 +02:00
rail
2a0e45b8db supress clippy::filter_map 2020-10-02 21:38:50 +13:00
rail
41a0ccbc57 add comments around loop_counters 2020-10-02 21:38:50 +13:00
bors
f0eac45db4 Auto merge of #6104 - mikerite:fix-6096, r=ebroto
Allow exponent separator

Fixes #6096

changelog: Fixed bug in `clippy::inconsistent_digit_grouping` when floating point exponent is used
2020-10-02 08:36:54 +00:00
rail
1402d8ae4f fix a FN where incr exprs with no semicolon at ends 2020-10-02 21:18:37 +13:00
Michael Wright
e91202cf68 Allow exponent separator
Fixes #6096
2020-10-02 07:02:58 +02:00
rail
94d7b82340 simplify the code 2020-10-02 14:04:46 +13:00
rail
388384177e document MinifyingSugg and Offset
...and also swap their position
2020-10-02 13:30:50 +13:00
bors
8c9800a3a9 Auto merge of #6102 - giraffate:no_lint_when_invalid_suggestion_in_needless_range_loop, r=flip1995
Don't emit a lint for the suggestion leading to errors in `needless_range_loop`

Fix #5945

changelog: Don't emit a lint for the suggestion leading to errors in `needless_range_loop`
2020-10-01 16:29:08 +00:00
Takayuki Nakata
0a91fe7016 Don't emit a lint for the suggestion leading to errors in needless_range_loop 2020-10-02 00:49:05 +09:00
flip1995
d28211ddb6
Fix rustup fallout 2020-10-01 16:40:59 +02:00
bors
d4313737d8 Auto merge of #5978 - montrivo:needless-lifetime, r=ebroto
needless-lifetime - nested elision sites

Closes #2944

changelog: fix needless-lifetime nested elision site FPs
2020-10-01 13:43:24 +00:00
bors
abce9e7c9f Auto merge of #6092 - jethrogb:jb/inline-asm-syntax-lint, r=ebroto
Add lint for inline assembly syntax style preference

changelog: Add lint for inline assembly syntax style preference
2020-09-30 21:44:29 +00:00
Eduardo Broto
507561ecfc
Update tests/ui/asm_syntax.rs
Use a single `only` header command in asm_syntax test
2020-09-30 23:30:49 +02:00
Jethro Beekman
0690f9c5d5 Add lint for inline assembly syntax style preference 2020-09-30 09:43:46 +02:00
Tim Nielens
cb2be6f9db needless-lifetime / pr remarks 2020-09-30 00:33:46 +02:00
Tim Nielens
aa2ac38fa7 needless-lifetime / add known problem item 2020-09-30 00:08:19 +02:00
Tim Nielens
124420f920 needless-lifetime / fix master merge 2020-09-29 23:06:08 +02:00
Tim Nielens
7cfe3dc2eb Merge branch 'master' into needless-lifetime 2020-09-29 22:51:59 +02:00
bors
99483be1c7 Auto merge of #6093 - ebroto:6089_renamed_lifetimes, r=Manishearth
needless arbitrary self: handle macros

This fixes two cases related to macros:

* If the parameter comes from expansion, do not lint as the user has no possibility of changing it. This is not directly related to the fixed issue, but we should probably do that.
* If *only* the lifetime name comes from expansion, lint, but allow the user decide the name of the lifetime. In the related issue, the lifetime was unnamed and then renamed by `async_trait`, so just removing the name in the suggestion would work, but in the general case a macro can rename a lifetime that was named differently, and we can't reliably know that name anymore.

As a hint for the reviewer, the expanded code for the test can be checked with this command (from the root dir of the repo):
```sh
rustc -L target/debug/test_build_base/needless_arbitrary_self_type_unfixable.stage-id.aux -Zunpretty=expanded tests/ui/needless_arbitrary_self_type_unfixable.rs
```

changelog: [`needless_arbitrary_self_type`]: handle macros

Fixes #6089
2020-09-29 08:41:39 +00:00
bors
ce678b9ac1 Auto merge of #6094 - ebroto:rustup, r=ebroto
Rustup

changelog: none

r? `@ghost`
2020-09-29 03:27:59 +00:00
Eduardo Broto
1b58144af5 Merge remote-tracking branch 'upstream/master' into rustup 2020-09-28 23:05:40 +02:00
Eduardo Broto
101e76f117 needless arbitrary self: handle macros 2020-09-28 19:17:22 +02:00
Ralf Jung
952ec7d066 Rollup merge of #76474 - bjorn3:driver_selected_codegen, r=oli-obk
Add option to pass a custom codegen backend from a driver

This allows the driver to pass information to the codegen backend. For example the headcrab debugger may in the future want to use cg_clif to JIT code to be injected in the debuggee. This would PR make it possible to tell cg_clif which symbol can be found at which address and to tell it to inject the JITed code into the right process.

This PR may also help with https://github.com/rust-lang/miri/pull/1540 by allowing miri to provide a codegen backend that only emits metadata and doesn't perform any codegen.

cc @nbaksalyar (headcrab)
cc @RalfJung (miri)
2020-09-28 18:39:40 +02:00
rail
ec94bd6cb4 split up the manual_memcpy test 2020-09-28 02:43:45 +13:00
bors
db6fb90bc0 Auto merge of #6091 - ebroto:rustup, r=ebroto
Rustup

changelog: none

r? `@ghost`
2020-09-27 13:33:48 +00:00
rail
9725f00f4d Use the From trait to make MinifyingSugg 2020-09-28 02:27:55 +13:00
Eduardo Broto
8bf27c5e92 Fix dogfood 2020-09-27 15:22:33 +02:00
Eduardo Broto
cd4706413f Run cargo dev fmt 2020-09-27 15:17:13 +02:00
Eduardo Broto
798a5cf5bc Merge remote-tracking branch 'upstream/master' into rustup 2020-09-27 15:09:52 +02:00
bjorn3
210e89198d Add option to pass a custom codegen backend from a driver 2020-09-27 14:16:42 +02:00
rail
99aceebf1c Use the spans of the entire for loops for suggestions 2020-09-27 16:38:41 +13:00
rail
5c71352b18 Prevent unnecessary lints from triggering 2020-09-27 14:54:20 +13:00
rail
4918e7ad62 Replace snippet_opt + unwrap_or_else with snippet 2020-09-27 14:19:43 +13:00
bors
949b834067 Auto merge of #6090 - Fishrock123:rc_buffer-formatting-caveats, r=yaahc
lints: clarify rc_buffer and add caveats

This didn't display some types properly in the docs due the lack of code formatting.

Also, refs for the caveat:
https://github.com/rust-lang/rust-clippy/pull/6044#issuecomment-699559082
https://github.com/http-rs/surf/pull/242

Fwiw I can't get `cargo test` to run, even on nightly. I get:
```
error[E0463]: can't find crate for `rustc_ast`
```

*Please keep the line below*
changelog: none, nightly
2020-09-27 00:38:23 +00:00
Jeremiah Senkpiel
00e641b914 lints: clarify rc_buffer and add caveats
This didn't display some types properly in the docs due the lack of code formatting.

Also, refs for the caveat:
https://github.com/rust-lang/rust-clippy/pull/6044#issuecomment-699559082
https://github.com/http-rs/surf/pull/242
2020-09-26 17:19:12 -07:00
bors
ea079eb8a4 Auto merge of #6081 - ilknarf:master, r=matthiaskrgr
New Lint: disallowed_method

Fixes https://github.com/rust-lang/rust-clippy/issues/6073

I added a `disallowed_method` lint that works similar to `blacklisted_name`, e.g allows config-defined disallowed method calls.

This lint allows advanced users to patch in undesired method calls for specific projects. It basically uses the DefId of method calls and matches it to parsed strings. Is there an alternative approach that could use more easily digestible configuration strings?

All tests pass as expected except for a linting error on `ui/redundant_pattern_matching_option`, which I am not sure how to resolve since I don't think I changed anything affecting it.

changelog: Add disallowed_method lint to warn on user-defined method calls
2020-09-26 20:55:53 +00:00
bors
b64d21d980 Auto merge of #6079 - giraffate:print_stdout_in_build_rs, r=ebroto
Fix FP in `print_stdout`

Fix #6041

This lint shouldn't be emitted in `build.rs` as `println!` and `print!` are used for the build script.

changelog: none
2020-09-26 20:34:35 +00:00
Eduardo Broto
1214a858e0
Add missing attr to clippy_workspace_tests/build.rs 2020-09-26 22:22:47 +02:00
Takayuki Nakata
71b6d54cd9 Add build script but does not work in the dogfood test 2020-09-26 23:54:18 +09:00
Oliver Scherer
7072e45c6c Remove all unstable feature support in the missing_const_for_fn lint 2020-09-26 16:23:56 +02:00
Takayuki Nakata
83294f894d Some small fixes 2020-09-26 23:10:25 +09:00
Oliver Scherer
a6fda14394 Move qualify_min_const_fn out of rustc into clippy 2020-09-26 16:08:24 +02:00
Frank
5f7b643758 update lint description 2020-09-25 11:12:45 -05:00
Frank
d18653158d remove useless test, update disallowed_method description 2020-09-25 11:09:04 -05:00
Frank
f9da2946d8 update error message, refactor disallowed_method 2020-09-25 11:09:04 -05:00
Frank
3886edb05a fix error message 2020-09-25 11:09:04 -05:00