]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoImprove needless_doctest_main by using the parser
Eduardo Broto [Sat, 15 Aug 2020 22:25:54 +0000 (00:25 +0200)]
Improve needless_doctest_main by using the parser

3 years agoAuto merge of #5910 - flip1995:rustup, r=flip1995
bors [Sat, 15 Aug 2020 12:05:11 +0000 (12:05 +0000)]
Auto merge of #5910 - flip1995:rustup, r=flip1995

Rustup

r? @ghost

changelog: none

3 years agoAuto merge of #5905 - ErichDonGubler:patch-1, r=flip1995
bors [Thu, 13 Aug 2020 19:54:48 +0000 (19:54 +0000)]
Auto merge of #5905 - ErichDonGubler:patch-1, r=flip1995

docs: typo in `temporary_cstring_as_ptr`: s/point/&s

changelog: none

3 years agodocs: typo in `temporary_cstring_as_ptr`: s/point/&s
Erich Gubler [Thu, 13 Aug 2020 19:52:21 +0000 (13:52 -0600)]
docs: typo in `temporary_cstring_as_ptr`: s/point/&s

3 years agomerge `as_local_hir_id` with `local_def_id_to_hir_id`
Bastian Kauschke [Wed, 12 Aug 2020 10:22:56 +0000 (12:22 +0200)]
merge `as_local_hir_id` with `local_def_id_to_hir_id`

3 years agoAuto merge of #5901 - giraffate:add_reference_to_rustc_dev_guide, r=matthiaskrgr
bors [Thu, 13 Aug 2020 13:54:53 +0000 (13:54 +0000)]
Auto merge of #5901 - giraffate:add_reference_to_rustc_dev_guide, r=matthiaskrgr

Add reference to rustc-dev-guide about lint message

I think it would be better to add lint message convention to documentation. I referred to https://github.com/rust-lang/rust-clippy/pull/5888 and https://github.com/rust-lang/rust-clippy/pull/5893.

changelog: none

3 years agoAuto merge of #5899 - JarredAllen:rc-box-suggestion, r=yaahc
bors [Thu, 13 Aug 2020 13:31:55 +0000 (13:31 +0000)]
Auto merge of #5899 - JarredAllen:rc-box-suggestion, r=yaahc

Change Rc<Box<T>> recommendation to be Rc<T> instead of Box<T>

Fixes #5722

changelog: Suggest `Rc<Box<T>>` -> `Rc<T>` in [`redundant_allocation`] lint

3 years agoAuto merge of #5900 - ThibsG:ParensUselessConversion4750, r=phansch
bors [Thu, 13 Aug 2020 05:27:29 +0000 (05:27 +0000)]
Auto merge of #5900 - ThibsG:ParensUselessConversion4750, r=phansch

Fix: keep parenthesis for suggestion in `useless_conversion` lint

Note: this lint was previously named `identity_conversion`.

fixes: #4750

changelog: fix parenthesis for `useless_conversion` lint suggestion

3 years agoAdd reference to rustc-dev-guide about lint message
Takayuki Nakata [Thu, 13 Aug 2020 00:02:49 +0000 (09:02 +0900)]
Add reference to rustc-dev-guide about lint message

3 years agoReplace panics with early returns
JarredAllen [Wed, 12 Aug 2020 20:24:55 +0000 (13:24 -0700)]
Replace panics with early returns

3 years agoFix: keep parenthesis for suggestion in `useless_conversion` lint
ThibsG [Wed, 12 Aug 2020 19:37:27 +0000 (21:37 +0200)]
Fix: keep parenthesis for suggestion in `useless_conversion` lint

3 years agoAuto merge of #5897 - matthiaskrgr:no_clone_tts, r=flip1995
bors [Wed, 12 Aug 2020 17:36:23 +0000 (17:36 +0000)]
Auto merge of #5897 - matthiaskrgr:no_clone_tts, r=flip1995

write.rs: don't clone TokenStream

changelog: none

3 years agoChange Rc<Box<T>> recommendation to be Rc<T> instead of Box<T>
JarredAllen [Wed, 12 Aug 2020 01:01:10 +0000 (18:01 -0700)]
Change Rc<Box<T>> recommendation to be Rc<T> instead of Box<T>

3 years agoAuto merge of #5884 - Ryan1729:patch-1, r=flip1995
bors [Wed, 12 Aug 2020 17:00:48 +0000 (17:00 +0000)]
Auto merge of #5884 - Ryan1729:patch-1, r=flip1995

Add the other overloadable operations to suspicious_arithmetic_impl

In #2268 I idly mused that the other user-overloadable operations could be added to this lint. Knowing that the lint was arguably incomplete was gnawing at the back of my mind, so I figured that I might as well make this PR, particularly given the change needed was so small.

changelog: Start warning on suspicious implementations of the `BitAnd`, `BitOr`, `BitXor`, `Rem`, `Shl`, and `Shr` traits.

3 years agorun tests/ui/update-references.sh to update 'suspicious_arithmetic_impl.rs'
Ryan1729 [Wed, 12 Aug 2020 16:49:12 +0000 (10:49 -0600)]
run tests/ui/update-references.sh to update 'suspicious_arithmetic_impl.rs'

3 years agoAuto merge of #5893 - matthiaskrgr:lint_msg, r=yaahc
bors [Wed, 12 Aug 2020 16:33:57 +0000 (16:33 +0000)]
Auto merge of #5893 - matthiaskrgr:lint_msg, r=yaahc

fix remaining lint messages

r? @yaahc

changelog:  make remaining lint messages adhere to rustc dev guide lint message convention.

3 years agoadd tests for Rem, BitAnd, BitOr, BitXor, Shl, and Shr
Ryan1729 [Wed, 12 Aug 2020 15:17:40 +0000 (09:17 -0600)]
add tests for Rem, BitAnd, BitOr, BitXor, Shl, and Shr

3 years agotrailing comma
Ryan Wiedemann [Mon, 10 Aug 2020 15:21:20 +0000 (09:21 -0600)]
trailing comma

Should have actually ran rustfmt on it, rather than attempting to fix it manually

3 years agoformatting
Ryan Wiedemann [Mon, 10 Aug 2020 15:18:16 +0000 (09:18 -0600)]
formatting

3 years agoAdd the other overloadable operations to suspicious_arithmetic_impl
Ryan Wiedemann [Mon, 10 Aug 2020 13:30:55 +0000 (07:30 -0600)]
Add the other overloadable operations to suspicious_arithmetic_impl

In #2268 I idly mused that the other user-overloadable operations could be added to this lint. Knowing that the lint was arguably incomplete was gnawing at the back of my mind, so I figured that I might as well make this PR, particularly given the change needed was so small.

3 years agoAuto merge of #5885 - Ryan1729:patch-2, r=flip1995
bors [Wed, 12 Aug 2020 15:51:39 +0000 (15:51 +0000)]
Auto merge of #5885 - Ryan1729:patch-2, r=flip1995

Add example of false positive to PTR_ARG docs.

Addresses #214

changelog: Add example of false positive to `ptr_arg` docs.

3 years agoAuto merge of #5898 - flip1995:rustup, r=flip1995
bors [Wed, 12 Aug 2020 15:11:25 +0000 (15:11 +0000)]
Auto merge of #5898 - flip1995:rustup, r=flip1995

Rustup

r? @ghost

changelog: none

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Wed, 12 Aug 2020 15:03:54 +0000 (17:03 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agofix typo pointed out in review comment
Ryan Wiedemann [Wed, 12 Aug 2020 14:54:32 +0000 (08:54 -0600)]
fix typo pointed out in review comment

Co-authored-by: Philipp Krones <hello@philkrones.com>
3 years agowrite.rs: don't clone TokenStream
Matthias Krüger [Wed, 12 Aug 2020 12:27:06 +0000 (14:27 +0200)]
write.rs: don't clone TokenStream

3 years agoAuto merge of #75405 - flip1995:clippyup, r=Manishearth
bors [Wed, 12 Aug 2020 00:34:19 +0000 (00:34 +0000)]
Auto merge of #75405 - flip1995:clippyup, r=Manishearth

Update Clippy

Biweekly Clippy update (2 days late, since I wanted to wait for https://github.com/rust-lang/rust/pull/75098)

r? @Manishearth

3 years agoMerge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup
flip1995 [Tue, 11 Aug 2020 13:43:21 +0000 (15:43 +0200)]
Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup

3 years agoif_not_else: make lint adhere to lint message convention
Matthias Krüger [Tue, 11 Aug 2020 14:43:53 +0000 (16:43 +0200)]
if_not_else: make lint adhere to lint message convention

3 years agoif_let_some_result: make lint adhere to lint message convention
Matthias Krüger [Tue, 11 Aug 2020 14:40:45 +0000 (16:40 +0200)]
if_let_some_result: make lint adhere to lint message convention

3 years agoenum-variant-names: make lint adhere to lint message convention
Matthias Krüger [Tue, 11 Aug 2020 14:38:20 +0000 (16:38 +0200)]
enum-variant-names: make lint adhere to lint message convention

3 years agoenum-clike-unportable-variant: tweak message a bit (Clike -> C-like)
Matthias Krüger [Tue, 11 Aug 2020 14:35:09 +0000 (16:35 +0200)]
enum-clike-unportable-variant: tweak message a bit (Clike -> C-like)

3 years agoduration-subsec: make lint adhere to lint message convention
Matthias Krüger [Tue, 11 Aug 2020 14:31:02 +0000 (16:31 +0200)]
duration-subsec: make lint adhere to lint message convention

3 years agopub-enum-variant-names: make lint adhere to lint message convention
Matthias Krüger [Tue, 11 Aug 2020 14:28:05 +0000 (16:28 +0200)]
pub-enum-variant-names: make lint adhere to lint message convention

3 years agomultiple_inherent_impl: make lint adhere to lint message convention
Matthias Krüger [Tue, 11 Aug 2020 13:28:51 +0000 (15:28 +0200)]
multiple_inherent_impl: make lint adhere to lint message convention

3 years agoimplicit-saturating-sub: make lint adhere to lint message convention
Matthias Krüger [Tue, 11 Aug 2020 13:22:59 +0000 (15:22 +0200)]
implicit-saturating-sub: make lint adhere to lint message convention

3 years agoint_plus_one: make lint adhere to lint message convention
Matthias Krüger [Tue, 11 Aug 2020 13:14:32 +0000 (15:14 +0200)]
int_plus_one: make lint adhere to lint message convention

3 years agoiter-next-slice: make lint adhere to lint message convention
Matthias Krüger [Tue, 11 Aug 2020 10:42:50 +0000 (12:42 +0200)]
iter-next-slice: make lint adhere to lint message convention

3 years agomutex-atomic: make lint adhere to lint message convention
Matthias Krüger [Tue, 11 Aug 2020 10:10:42 +0000 (12:10 +0200)]
mutex-atomic: make lint adhere to lint message convention

3 years agomap_clone: make lint adhere to lint message convention
Matthias Krüger [Tue, 11 Aug 2020 09:53:21 +0000 (11:53 +0200)]
map_clone: make lint adhere to lint message convention

3 years agostable-sort-primitive: make lint adhere to lint message convention
Matthias Krüger [Tue, 11 Aug 2020 09:50:26 +0000 (11:50 +0200)]
stable-sort-primitive: make lint adhere to lint message convention

3 years agoAuto merge of #5892 - matthiaskrgr:redundant_mut, r=flip1995
bors [Tue, 11 Aug 2020 12:52:41 +0000 (12:52 +0000)]
Auto merge of #5892 - matthiaskrgr:redundant_mut, r=flip1995

unnecessary-mut-passed: make lint message say if fn is a function or a method

changelog: refine "unnecessary-mut-passed" lint message

3 years agoAuto merge of #5891 - flip1995:rustup, r=flip1995
bors [Tue, 11 Aug 2020 12:32:10 +0000 (12:32 +0000)]
Auto merge of #5891 - flip1995:rustup, r=flip1995

Rustup

r? @ghost

Sync back rust-lang/rust#75098

changelog: none

3 years agoFix sync fallout
flip1995 [Tue, 11 Aug 2020 11:57:32 +0000 (13:57 +0200)]
Fix sync fallout

3 years agounnecessary-mut-passed: make lint message say if fn is a function or a method.
Matthias Krüger [Tue, 11 Aug 2020 10:35:55 +0000 (12:35 +0200)]
unnecessary-mut-passed: make lint message say if fn is a function or a method.

3 years agoRollup merge of #75226 - pnadon:miri-undef-uninit, r=RalfJung
Yuki Okushi [Tue, 11 Aug 2020 07:23:47 +0000 (16:23 +0900)]
Rollup merge of #75226 - pnadon:miri-undef-uninit, r=RalfJung

Miri: Renamed "undef" to "uninit"

Renamed remaining references to "undef" to "uninit" when referring to Miri.

Impacted directories are:

- `src/librustc_codegen_llvm/consts.rs`
- `src/librustc_middle/mir/interpret/`
- `src/librustc_middle/ty/print/pretty.rs`
- `src/librustc_mir/`
- `src/tools/clippy/clippy_lints/src/consts.rs`

Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project.

Related issue #71193

3 years agoRollup merge of #75098 - Ryan1729:clippy-pointer-cast-lint-experiment, r=oli-obk
Dylan DPC [Mon, 10 Aug 2020 23:56:30 +0000 (01:56 +0200)]
Rollup merge of #75098 - Ryan1729:clippy-pointer-cast-lint-experiment, r=oli-obk

Clippy pointer cast lint experiment

This PR is an experiment about exposing more parts of `rustc_typeck` for use in `clippy`. In particular, the code that checks where a cast is valid or not was exposed, which necessitated exposing [`FnCtxt`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/struct.FnCtxt.html), and figuring out how to create an instance of that type inside `clippy`.

This was prompted by [this clippy issue](https://github.com/rust-lang/rust-clippy/issues/2064).

r? @oli-obk

3 years agoAuto merge of #5888 - matthiaskrgr:lints, r=yaahc
bors [Mon, 10 Aug 2020 22:40:42 +0000 (22:40 +0000)]
Auto merge of #5888 - matthiaskrgr:lints, r=yaahc

make a bunch of lints texts adhere to rustc dev guide

According to the rustc-dev guide: "The text should be matter of fact and avoid capitalization and periods, unless multiple sentences are needed"

changelog: make some lint output adhere to the rustc-dev guide

3 years agoupdate test stderr
Matthias Krüger [Mon, 10 Aug 2020 22:27:55 +0000 (00:27 +0200)]
update test stderr

3 years agoAuto merge of #5889 - ebroto:5886_or_fun_call_const_0_args, r=Manishearth
bors [Mon, 10 Aug 2020 22:12:38 +0000 (22:12 +0000)]
Auto merge of #5889 - ebroto:5886_or_fun_call_const_0_args, r=Manishearth

Avoid or_fun_call for const_fn with no args

Based on #5682 by @lzutao

This avoids a subset of false positives, specifically those related to `const fn`s that take no arguments.
For the rest, a much more involved fix would be needed, see https://github.com/rust-lang/rust-clippy/pull/5682#issuecomment-638681210.

So this does *not* solve #5658

changelog: Avoid triggering [`or_fun_call`] with `const fn`s that take no arguments.

Fixes #5886

3 years agorun cargo dev update-lints
Matthias Krüger [Mon, 10 Aug 2020 21:55:15 +0000 (23:55 +0200)]
run cargo dev update-lints

3 years agoUpdate clippy_lints/src/unwrap.rs
Matthias Krüger [Mon, 10 Aug 2020 21:50:52 +0000 (23:50 +0200)]
Update clippy_lints/src/unwrap.rs

Co-authored-by: Jane Lusby <jlusby42@gmail.com>
3 years agoUpdate clippy_lints/src/neg_cmp_op_on_partial_ord.rs
Matthias Krüger [Mon, 10 Aug 2020 21:50:40 +0000 (23:50 +0200)]
Update clippy_lints/src/neg_cmp_op_on_partial_ord.rs

Co-authored-by: Jane Lusby <jlusby42@gmail.com>
3 years agoneg-cmp-op-on-partial-ord: make lint adhere to lint message convention
Matthias Krüger [Tue, 28 Jul 2020 10:13:22 +0000 (12:13 +0200)]
neg-cmp-op-on-partial-ord: make lint adhere to lint message convention

3 years agoneg-multiply: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 22:24:11 +0000 (00:24 +0200)]
neg-multiply: make lint adhere to lint message convention

3 years agooverflow-check-conditional: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 22:18:34 +0000 (00:18 +0200)]
overflow-check-conditional: make lint adhere to lint message convention

3 years agopath-buf-push-overwrite: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 22:16:28 +0000 (00:16 +0200)]
path-buf-push-overwrite: make lint adhere to lint message convention

3 years agorange-zip-with-len: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 22:12:21 +0000 (00:12 +0200)]
range-zip-with-len: make lint adhere to lint message convention

3 years agoredundant-static-lifetimes: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 21:54:34 +0000 (23:54 +0200)]
redundant-static-lifetimes: make lint adhere to lint message convention

3 years agoalso change "deprecated-attribute" message
Matthias Krüger [Thu, 23 Jul 2020 21:46:52 +0000 (23:46 +0200)]
also change "deprecated-attribute" message

3 years agosuspicious-arithmetic-impl: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 21:45:24 +0000 (23:45 +0200)]
suspicious-arithmetic-impl: make lint adhere to lint message convention

3 years agounknown: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 21:37:16 +0000 (23:37 +0200)]
unknown: make lint adhere to lint message convention

3 years agoref_in_deref: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 21:36:20 +0000 (23:36 +0200)]
ref_in_deref: make lint adhere to lint message convention

3 years agounneeded-field-pattern: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 21:31:33 +0000 (23:31 +0200)]
unneeded-field-pattern: make lint adhere to lint message convention

3 years agoempty-liner-after-outer-attr: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 20:40:50 +0000 (22:40 +0200)]
empty-liner-after-outer-attr: make lint adhere to lint message convention

3 years agodrop_bounds: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 18:05:42 +0000 (20:05 +0200)]
drop_bounds: make lint adhere to lint message convention

3 years agodouble-parens: make lint adhere to lint message convention and do minor refactoring
Matthias Krüger [Thu, 23 Jul 2020 17:56:01 +0000 (19:56 +0200)]
double-parens: make lint adhere to lint message convention and do minor refactoring

3 years agodouble-comparisons: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 17:50:28 +0000 (19:50 +0200)]
double-comparisons: make lint adhere to lint message convention

3 years agodefault-trait-access: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 17:39:35 +0000 (19:39 +0200)]
default-trait-access: make lint adhere to lint message convention

3 years agocmp_null: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 17:21:31 +0000 (19:21 +0200)]
cmp_null: make lint adhere to lint message convention

3 years agounnecessary_unwrap, panicking_unwrap: make lints adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 15:06:29 +0000 (17:06 +0200)]
unnecessary_unwrap, panicking_unwrap: make lints adhere to lint message convention

3 years agochecked-conversions: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 14:58:20 +0000 (16:58 +0200)]
checked-conversions: make lint adhere to lint message convention

3 years agoAvoid or_fun_call for const_fn with no args
Eduardo Broto [Mon, 10 Aug 2020 21:38:58 +0000 (23:38 +0200)]
Avoid or_fun_call for const_fn with no args

3 years agonaive_bytecount: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 13:18:13 +0000 (15:18 +0200)]
naive_bytecount: make lint adhere to lint message convention

3 years agobuiltin-type-shadow: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 13:16:10 +0000 (15:16 +0200)]
builtin-type-shadow: make lint adhere to lint message convention

3 years agobool-comparison: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 13:14:12 +0000 (15:14 +0200)]
bool-comparison: make lint adhere to lint message convention

3 years agotoo-many-lines: make lint adhere to lint message convention
Matthias Krüger [Thu, 23 Jul 2020 13:06:33 +0000 (15:06 +0200)]
too-many-lines: make lint adhere to lint message convention

3 years agoAuto merge of #5887 - robojumper:patch-1, r=flip1995
bors [Mon, 10 Aug 2020 17:51:37 +0000 (17:51 +0000)]
Auto merge of #5887 - robojumper:patch-1, r=flip1995

Fix CHANGELOG's commit range links

Two most recent links linked to the wrong range

changelog: none

3 years agoFix CHANGELOG's commit range links
robojumper [Mon, 10 Aug 2020 15:45:04 +0000 (17:45 +0200)]
Fix CHANGELOG's commit range links

Two most recent links linked to the wrong range

changelog: none

3 years agoformatting
Ryan Wiedemann [Mon, 10 Aug 2020 15:19:40 +0000 (09:19 -0600)]
formatting

3 years agoAdd example of false positive to PTR_ARG docs.
Ryan Wiedemann [Mon, 10 Aug 2020 14:50:20 +0000 (08:50 -0600)]
Add example of false positive to PTR_ARG docs.

Fixes #214

3 years agoAuto merge of #5883 - flip1995:rollup-x9mftxe, r=flip1995
bors [Mon, 10 Aug 2020 13:02:53 +0000 (13:02 +0000)]
Auto merge of #5883 - flip1995:rollup-x9mftxe, r=flip1995

Rollup of 5 pull requests

Successful merges:

 - #5825 (Add the new lint `same_item_push`)
 - #5869 (New lint against `Self` as an arbitrary self type)
 - #5870 (enable #[allow(clippy::unsafe_derive_deserialize)])
 - #5871 (Lint .min(x).max(y) with x < y)
 - #5874 (Make the docs clearer for new contributors)

Failed merges:

r? @ghost

changelog: rollup

3 years agoRollup merge of #5874 - camelid:patch-1, r=flip1995
Philipp Krones [Mon, 10 Aug 2020 12:56:30 +0000 (14:56 +0200)]
Rollup merge of #5874 - camelid:patch-1, r=flip1995

Make the docs clearer for new contributors

It confused me before, so I made it extra obvious that you need to run
a script to set up your toolchain before you can build Clippy.

I also added a note so that new contributors aren't confused when
Clippy doesn't build as a result of a change in rustc's internals.

changelog: make `CONTRIBUTING.md` clearer for new contributors

3 years agoRollup merge of #5871 - wiomoc:feature/methodcall-minmax, r=flip1995
Philipp Krones [Mon, 10 Aug 2020 12:56:29 +0000 (14:56 +0200)]
Rollup merge of #5871 - wiomoc:feature/methodcall-minmax, r=flip1995

Lint .min(x).max(y) with x < y

Fixes  #5854

changelog: Also lint `ord.min(a).max(b)`, where `a < b` in [`min_max`] lint

3 years agoRollup merge of #5870 - ebroto:5789_allow_unsafe_derive_deserialize, r=flip1995
Philipp Krones [Mon, 10 Aug 2020 12:56:27 +0000 (14:56 +0200)]
Rollup merge of #5870 - ebroto:5789_allow_unsafe_derive_deserialize, r=flip1995

enable #[allow(clippy::unsafe_derive_deserialize)]

Before this change this lint could not be allowed as the code we are checking is automatically generated.

changelog: Enable using the `allow` attribute on top of an ADT linted by [`unsafe_derive_deserialize`].

Fixes: #5789
3 years agoRollup merge of #5869 - wiomoc:feature/implicit-self, r=ebroto,flip1995
Philipp Krones [Mon, 10 Aug 2020 12:56:26 +0000 (14:56 +0200)]
Rollup merge of #5869 - wiomoc:feature/implicit-self, r=ebroto,flip1995

New lint against `Self` as an arbitrary self type

Fixes #5861

changelog: * [`needless_arbitrary_self_type`] [#5869](https://github.com/rust-lang/rust-clippy/pull/5869)

3 years agoRollup merge of #5825 - giraffate:same_item_push, r=Manishearth
Philipp Krones [Mon, 10 Aug 2020 12:56:25 +0000 (14:56 +0200)]
Rollup merge of #5825 - giraffate:same_item_push, r=Manishearth

Add the new lint `same_item_push`

changelog: Add the new lint `same_item_push`

Fixed #4078. As I said in https://github.com/rust-lang/rust-clippy/issues/4078#issuecomment-658184195, I referrerd to https://github.com/rust-lang/rust-clippy/pull/4647.

3 years agoAuto merge of #5882 - dima74:ra_setup-prevent-compile-rustc, r=Manishearth
bors [Sun, 9 Aug 2020 19:18:01 +0000 (19:18 +0000)]
Auto merge of #5882 - dima74:ra_setup-prevent-compile-rustc, r=Manishearth

Prevent compile parts of rustc when using `cargo dev ra-setup`

Currently after running `cargo dev ra-setup` the following lines are added to `Cargo.toml`:

```toml
[target]
rustc_data_structures = { path = ".../rust/src/librustc_data_structures" }
rustc_driver = { path = ".../rust/src/librustc_driver" }
rustc_errors = { path = ".../rust/src/librustc_errors" }
rustc_interface = { path = ".../rust/src/librustc_interface" }
rustc_middle = { path = ".../rust/src/librustc_middle" }
```

This pull request adds dependencies for `rustc` crates under `cfg(NOT_A_PLATFORM)`, thus preventing them from compiling together with clippy:

```toml
[target.'cfg(NOT_A_PLATFORM)'.dependencies]
rustc_data_structures = { path = ".../rust/src/librustc_data_structures" }
rustc_driver = { path = ".../rust/src/librustc_driver" }
rustc_errors = { path = ".../rust/src/librustc_errors" }
rustc_interface = { path = ".../rust/src/librustc_interface" }
rustc_middle = { path = ".../rust/src/librustc_middle" }
```

---

This approach was [originally proposed for IntelliJ Rust](https://github.com/intellij-rust/intellij-rust/issues/1618#issuecomment-459098749), and looks like it works for rust-analyzer too.

changelog: none

3 years agoPrevent compile parts of rustc when using `cargo dev ra-setup`
Dmitry Murzin [Sun, 9 Aug 2020 17:21:09 +0000 (22:21 +0500)]
Prevent compile parts of rustc when using `cargo dev ra-setup`

3 years agoadd allow unused_unsafe and allow dead_code
Ryan1729 [Sun, 9 Aug 2020 06:39:14 +0000 (00:39 -0600)]
add allow unused_unsafe and allow dead_code

3 years agofix unary minus on usize and unused variable errors in .fixed file
Ryan1729 [Sun, 9 Aug 2020 06:28:56 +0000 (00:28 -0600)]
fix unary minus on usize and unused variable errors in .fixed file

3 years agoadd a test example of where transmutes_expressible_as_ptr_casts should not suggest...
Ryan1729 [Sun, 9 Aug 2020 06:15:56 +0000 (00:15 -0600)]
add a test example of where transmutes_expressible_as_ptr_casts should not suggest anything

3 years agoupdate stderr for transmutes_expressible_as_ptr_casts
Ryan1729 [Sun, 9 Aug 2020 03:03:41 +0000 (21:03 -0600)]
update stderr for transmutes_expressible_as_ptr_casts

3 years agoAuto merge of #5877 - ebroto:5872_loops_ice, r=Manishearth
bors [Sat, 8 Aug 2020 18:44:48 +0000 (18:44 +0000)]
Auto merge of #5877 - ebroto:5872_loops_ice, r=Manishearth

Fix ICE in `loops` module

changelog: Fix ICE related to `needless_collect` when a call to `iter()` was not present.

I went for restoring the old suggestion of `next().is_some()` over `get(0).is_some()` given that `iter()` is not necessarily present (could be e.g. `into_iter()` or `iter_mut()`)  and that the old suggestion could change semantics, e.g. a call to `filter()` could be present between `iter()` and the collect part.

Fixes #5872

3 years agoAuto merge of #5878 - flip1995:rustup, r=flip1995
bors [Sat, 8 Aug 2020 17:28:34 +0000 (17:28 +0000)]
Auto merge of #5878 - flip1995:rustup, r=flip1995

Rustup

r? @ghost

changelog: none

3 years agoRun fmt
flip1995 [Sat, 8 Aug 2020 17:20:34 +0000 (19:20 +0200)]
Run fmt

3 years agoFix ICE in `loops` module
Eduardo Broto [Sat, 8 Aug 2020 16:13:43 +0000 (18:13 +0200)]
Fix ICE in `loops` module

3 years agoMiri: Renamed "undef" to "uninit"
Philippe Nadon [Sat, 8 Aug 2020 13:53:47 +0000 (07:53 -0600)]
Miri: Renamed "undef" to "uninit"

Renamed remaining references to "undef" to "uninit" when referring to Miri.

Impacted directories are:

- src/librustc_codegen_llvm/consts.rs
- src/librustc_middle/mir/interpret/
- src/librustc_middle/ty/print/pretty.rs
- src/librustc_mir/
- src/tools/clippy/clippy_lints/src/consts.rs

Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project.

Related issue #71193

3 years agoEliminate the `SessionGlobals` from `librustc_ast`.
Nicholas Nethercote [Thu, 30 Jul 2020 01:27:50 +0000 (11:27 +1000)]
Eliminate the `SessionGlobals` from `librustc_ast`.

By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This
means they are accessed via the `Session`, rather than via TLS. A few
`Attr` methods and `librustc_ast` functions are now methods of
`Session`.

All of this required passing a `Session` to lots of functions that didn't
already have one. Some of these functions also had arguments removed, because
those arguments could be accessed directly via the `Session` argument.

`contains_feature_attr()` was dead, and is removed.

Some functions were moved from `librustc_ast` elsewhere because they now need
to access `Session`, which isn't available in that crate.
- `entry_point_type()` --> `librustc_builtin_macros`
- `global_allocator_spans()` --> `librustc_metadata`
- `is_proc_macro_attr()` --> `Session`

3 years agoMake the docs clearer for new contributors
Camelid [Fri, 7 Aug 2020 21:21:14 +0000 (14:21 -0700)]
Make the docs clearer for new contributors

* Add an easy-to-see note at the top of `CONTRIBUTING.md` that points
  new contributors to the Basics docs
* Add a note about compiler errors as a result of internals changes
  that break Clippy

3 years agocheck impl Ord / is_float
Christoph Walcher [Fri, 7 Aug 2020 15:55:25 +0000 (17:55 +0200)]
check impl Ord / is_float