Commit graph

9688 commits

Author SHA1 Message Date
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
Frank
725a0ef8b1 change config variables to reference, remove wildcard import 2020-09-25 11:09:04 -05:00
Frank
9eb52d2eb6 update toml_unknown_key test 2020-09-25 11:09:04 -05:00
Frank
e1b3f85e98 run cargo dev fmt 2020-09-25 11:09:04 -05:00
Frank
f4d88cbb1f run cargo dev update_lints 2020-09-25 11:09:04 -05:00
Frank
12e5637f75 update unused variable 2020-09-25 11:09:04 -05:00
Frank
1479c18396 add disallowed_method lint 2020-09-25 11:09:04 -05:00
Takayuki Nakata
5b484b4057 Fix the detection of build scripts 2020-09-25 23:32:18 +09:00
bors
6e5306dcc3 Auto merge of #6084 - ebroto:ui_tests_cleanup, r=flip1995
UI tests cleanup

`@matthiaskrgr` noticed some `run-pass` annotations in some crash tests that were added in #3922. At that moment they seemed to be necessary to make the tests fail in case of an ICE, but they do not seem to be needed anymore. To test this I forced an ICE in a file with and without annotations, with and without stderr files, and the ICE makes the test fail every time.

In addition, I've applied a suggestion from `@ehuss` and `@jyn514` to add `emit=metadata` to the rustc flags for the UI tests. In my machine this improved the run time from ~17 to ~12 seconds.

changelog: none
2020-09-25 14:14:25 +00:00
Eduardo Broto
1cb3c00cba Use emit=link for auxiliary proc macro crates 2020-09-25 15:46:32 +02:00
Eduardo Broto
fd0656109f Add emit=metadata to UI tests build flags
This should improve the performance by avoiding codegen
2020-09-25 15:20:04 +02:00
Eduardo Broto
6b59675449 Remove run-pass annotations from crash tests
It does not seem to be necessary
2020-09-25 15:19:36 +02:00