]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoChange the suggestion for `while_let_on_iterator` when the iterator cannot be consume...
Jason Newcomb [Sat, 18 Sep 2021 01:44:21 +0000 (21:44 -0400)]
Change the suggestion for `while_let_on_iterator` when the iterator cannot be consumed to `iter.by_ref()`

2 years agoAuto merge of #7671 - dtolnay-contrib:singlecharnames, r=xFrednet
bors [Tue, 14 Sep 2021 17:37:32 +0000 (17:37 +0000)]
Auto merge of #7671 - dtolnay-contrib:singlecharnames, r=xFrednet

Downgrade many_single_char_names to pedantic

As suggested by `@flip1995` in https://github.com/rust-lang/rust-clippy/issues/7666#issuecomment-918993215, by today's standards this lint would be considered `pedantic`.

This is one of the most widely suppressed Clippy lints on crates.io according to https://github.com/dtolnay/noisy-clippy.

In my opinion this lint is just too domain specific for Clippy to have reliable visibility into. Sure there are some cases where the author is just being lazy and could use a kick in the butt, but we're still left with an enormous number of suppressions where single chars are the most appropriate name. For example in the context of colors, a function using `h`, `s`, `l`, `r`, `g`, `b` is 100% sensible and spelling all those out is silly, but it's past the default lint threshold.

---

changelog: Moved [`many_single_char_names`] to `pedantic`

2 years agoDowngrade many_single_char_names to pedantic
David Tolnay [Tue, 14 Sep 2021 16:48:30 +0000 (09:48 -0700)]
Downgrade many_single_char_names to pedantic

2 years agoAuto merge of #7640 - kneasle:mut-key-false-positive, r=camsteffen
bors [Tue, 14 Sep 2021 15:56:07 +0000 (15:56 +0000)]
Auto merge of #7640 - kneasle:mut-key-false-positive, r=camsteffen

Improve accuracy of `mut_key`

Fixes #6745.

Whilst writing the tests for this, I noticed what I believe is a false negative (the code in `@xFrednet's` [comment](https://github.com/rust-lang/rust-clippy/issues/6745#issuecomment-909658267) doesn't trigger the lint).  Currently the tests contain a case for this (which is blatantly ignored), but I'm not at all sure how to implement this (since the lint currently behaves completely differently for ADTs).  I'm not sure what should be done - on the one hand the extra test cases are misleading, but on the other hand they don't cause much harm and would save effort for anyone fixing that false negative.

---

changelog: Improve accuracy of `clippy::mutable_key_type`.

2 years agoFix FN for collections/smart ptrs in `std`
Kneasle [Wed, 8 Sep 2021 21:51:47 +0000 (22:51 +0100)]
Fix FN for collections/smart ptrs in `std`

2 years agoAuto merge of #7670 - xFrednet:0000-lets-hope-this-fixes-rustbot-fps, r=camsteffen
bors [Tue, 14 Sep 2021 13:57:41 +0000 (13:57 +0000)]
Auto merge of #7670 - xFrednet:0000-lets-hope-this-fixes-rustbot-fps, r=camsteffen

Updating issue templates to avoid @rustbot triggers

This adds a space between the ``@`` and the name *rustbot*. This should now surely fix it. If not, I'm giving up.

@ rustbot label +C-bug

---

changelog: none

r? `@camsteffen`

2 years agoUpdating issue templates to avoid @rustbot triggers
xFrednet [Tue, 14 Sep 2021 13:49:43 +0000 (15:49 +0200)]
Updating issue templates to avoid @rustbot triggers

2 years agoFix FP when using raw pointers as hashed keys
Kneasle [Sun, 5 Sep 2021 20:58:47 +0000 (21:58 +0100)]
Fix FP when using raw pointers as hashed keys

2 years agoAuto merge of #7646 - camsteffen:relative-target, r=flip1995
bors [Mon, 13 Sep 2021 09:57:01 +0000 (09:57 +0000)]
Auto merge of #7646 - camsteffen:relative-target, r=flip1995

Target directory cleanup

changelog: none

* .cargo/config now has `target-dir` specified so that it is inherited by child projects. The target directory needs to be shared with clippy_dev, but not necessarily at the project root. (cc #7625)
* Uses `std::env::current_exe` (and its parent directories) whenever possible
* `CLIPPY_DRIVER_PATH` and `TARGET_LIBS` are no longer required from rustc bootstrap (but `HOST_LIBS` still is). These can be removed from the rustc side after merging.
* `CLIPPY_DOGFOOD` and the separate target directory are removed. This was originally added to mitigate #7343.

r? `@flip1995`

2 years agoAuto merge of #7661 - camsteffen:eta, r=giraffate
bors [Mon, 13 Sep 2021 00:39:34 +0000 (00:39 +0000)]
Auto merge of #7661 - camsteffen:eta, r=giraffate

Fix various redundant_closure bugs

changelog: Fix various false negatives and false positives for [`redundant_closure`]

Closes #3071
Closes #4002

This lint is full of weird nuances and this is basically a re-write to tighten up the logic.

2 years agoAuto merge of #7663 - Jarcho:rsplit_once_order, r=llogiq
bors [Sat, 11 Sep 2021 08:29:52 +0000 (08:29 +0000)]
Auto merge of #7663 - Jarcho:rsplit_once_order, r=llogiq

Fix result order for `manual_split_once` when `rsplitn` is used

fixes: #7656

changelog: Fix result order for `manual_split_once` when `rsplitn` is used

2 years agoFix result order for `manual_split_once` when `rsplitn` is used
Jason Newcomb [Fri, 10 Sep 2021 16:20:39 +0000 (12:20 -0400)]
Fix result order for `manual_split_once` when `rsplitn` is used

2 years agoAuto merge of #7660 - HKalbasi:derivable-impls, r=camsteffen
bors [Fri, 10 Sep 2021 15:32:16 +0000 (15:32 +0000)]
Auto merge of #7660 - HKalbasi:derivable-impls, r=camsteffen

Fix derivable impl false positives

fix #7654
fix #7655

changelog: none (not released)

2 years agofix derivable impl false positives
hamidreza kalbasi [Fri, 10 Sep 2021 13:40:55 +0000 (18:10 +0430)]
fix derivable impl false positives

2 years agoEat dogfood
Cameron Steffen [Thu, 9 Sep 2021 20:36:06 +0000 (15:36 -0500)]
Eat dogfood

2 years agoFix redundant closure bugs
Cameron Steffen [Thu, 9 Sep 2021 20:35:26 +0000 (15:35 -0500)]
Fix redundant closure bugs

2 years agoAuto merge of #7649 - flip1995:backport_remerge, r=flip1995
bors [Thu, 9 Sep 2021 14:47:28 +0000 (14:47 +0000)]
Auto merge of #7649 - flip1995:backport_remerge, r=flip1995

Backport remerge

This is to keep the backported commit in the repository before force pushing the new beta branch.

r? `@ghost`

changelog: none
(literally none)

2 years agoMerge remote-tracking branch 'upstream/beta' into backport_remerge
flip1995 [Thu, 9 Sep 2021 14:45:20 +0000 (16:45 +0200)]
Merge remote-tracking branch 'upstream/beta' into backport_remerge

2 years agoAuto merge of #7610 - Labelray:master, r=camsteffen
bors [Thu, 9 Sep 2021 01:47:08 +0000 (01:47 +0000)]
Auto merge of #7610 - Labelray:master, r=camsteffen

Add new lint `iter_not_returning_iterator`

Add new lint [`iter_not_returning_iterator`] to detect method `iter()` or `iter_mut()` returning a type not implementing `Iterator`
changelog: Add new lint [`iter_not_returning_iterator`]

2 years agoAuto merge of #7621 - azdavis:master, r=camsteffen
bors [Thu, 9 Sep 2021 01:31:15 +0000 (01:31 +0000)]
Auto merge of #7621 - azdavis:master, r=camsteffen

Allow giving reasons for `disallowed_methods`

Fixes #7609.

This permits writing the config for `disallowed-methods` as either a list of strings (like before) or a list of tables, where each table gives the path to the disallowed method and an optional reason for why the method is disallowed.

changelog: Allow giving reasons for [`disallowed_methods`]

2 years agoadd new lint `iter_not_returning_iterator`
Labelray [Tue, 7 Sep 2021 01:59:21 +0000 (09:59 +0800)]
add new lint `iter_not_returning_iterator`

2 years agoAllow giving reasons for disallowed_methods
Ariel Davis [Thu, 9 Sep 2021 01:12:02 +0000 (21:12 -0400)]
Allow giving reasons for disallowed_methods

2 years agoRemove special dogfood target
Cameron Steffen [Wed, 8 Sep 2021 18:34:00 +0000 (13:34 -0500)]
Remove special dogfood target

2 years agoRemove target dir from aliases
Cameron Steffen [Wed, 8 Sep 2021 17:50:57 +0000 (12:50 -0500)]
Remove target dir from aliases

2 years agoRename test_build_base to test
Cameron Steffen [Wed, 8 Sep 2021 15:59:05 +0000 (10:59 -0500)]
Rename test_build_base to test

2 years agoUse relative path for test builds
Cameron Steffen [Wed, 8 Sep 2021 15:58:18 +0000 (10:58 -0500)]
Use relative path for test builds

2 years agoUse relative exe paths
Cameron Steffen [Wed, 8 Sep 2021 15:55:08 +0000 (10:55 -0500)]
Use relative exe paths

2 years agoMake host libs -L flag optional
Cameron Steffen [Wed, 8 Sep 2021 15:45:44 +0000 (10:45 -0500)]
Make host libs -L flag optional

2 years agoUse relative deps path
Cameron Steffen [Wed, 8 Sep 2021 15:41:09 +0000 (10:41 -0500)]
Use relative deps path

2 years agoAdd target to cargo config
Cameron Steffen [Wed, 8 Sep 2021 19:05:49 +0000 (14:05 -0500)]
Add target to cargo config

2 years agoAuto merge of #7631 - camsteffen:depinfo, r=flip1995
bors [Wed, 8 Sep 2021 13:30:11 +0000 (13:30 +0000)]
Auto merge of #7631 - camsteffen:depinfo, r=flip1995

Use binary-dep-depinfo to resolve UI test dependencies

Closes #7343
Closes #6809
Closes #3643

changelog: none

r? `@flip1995`
cc `@Jarcho`

2 years agoDeny warnings in test modules
Cameron Steffen [Wed, 8 Sep 2021 13:19:14 +0000 (08:19 -0500)]
Deny warnings in test modules

2 years agoUse binary-dep-depinfo to resolve UI dependencies
Cameron Steffen [Fri, 3 Sep 2021 20:24:29 +0000 (15:24 -0500)]
Use binary-dep-depinfo to resolve UI dependencies

2 years agoRemove unused dependencies
Cameron Steffen [Fri, 3 Sep 2021 20:55:14 +0000 (15:55 -0500)]
Remove unused dependencies

2 years agoAuto merge of #7644 - flip1995:rustup, r=flip1995
bors [Wed, 8 Sep 2021 09:00:54 +0000 (09:00 +0000)]
Auto merge of #7644 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

2 years agoBump Clippy Version -> 0.1.57
flip1995 [Wed, 8 Sep 2021 08:59:04 +0000 (10:59 +0200)]
Bump Clippy Version -> 0.1.57

2 years agoBump nightly version -> 2021-09-08
flip1995 [Wed, 8 Sep 2021 08:58:51 +0000 (10:58 +0200)]
Bump nightly version -> 2021-09-08

2 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Wed, 8 Sep 2021 08:50:04 +0000 (10:50 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

2 years agoAuto merge of #7607 - dswij:mut-range-bound-break, r=flip1995
bors [Wed, 8 Sep 2021 08:14:17 +0000 (08:14 +0000)]
Auto merge of #7607 - dswij:mut-range-bound-break, r=flip1995

`mut_range_bound` check for immediate break after mutation

closes #7532

`mut_range_bound` ignores mutation on range bounds that is placed immediately before break. Still warns if the break is not always reachable.

changelog: [`mut_range_bound`] ignore range bound mutations before immediate break

2 years agoAdd known problems to `mut_range_bound` docs
dswij [Mon, 6 Sep 2021 22:07:50 +0000 (06:07 +0800)]
Add known problems to `mut_range_bound` docs

2 years agoUpdate test output for `mut_range_bound`
dswij [Fri, 3 Sep 2021 04:27:05 +0000 (12:27 +0800)]
Update test output for `mut_range_bound`

2 years ago`mut_range_bound` to check for immediate break from loop
dswij [Thu, 2 Sep 2021 08:04:46 +0000 (16:04 +0800)]
`mut_range_bound` to check for immediate break from loop

2 years agoAdd additional test for broken loop in `mut_range_bound`
dswij [Thu, 26 Aug 2021 10:20:13 +0000 (18:20 +0800)]
Add additional test for broken loop in `mut_range_bound`

2 years agoAuto merge of #7642 - mikerite:fix-7641, r=flip1995
bors [Tue, 7 Sep 2021 08:16:36 +0000 (08:16 +0000)]
Auto merge of #7642 - mikerite:fix-7641, r=flip1995

Add `TAU` to `approx_constant`

changelog: [`approx_constant`]: Add `TAU`

2 years agoAdd `TAU` to `approx_constant`
Michael Wright [Tue, 7 Sep 2021 03:50:04 +0000 (05:50 +0200)]
Add `TAU` to `approx_constant`

2 years agoAuto merge of #7634 - chansuke:update-eval-order-depends-docs, r=Manishearth
bors [Mon, 6 Sep 2021 07:51:55 +0000 (07:51 +0000)]
Auto merge of #7634 - chansuke:update-eval-order-depends-docs, r=Manishearth

Fix documentation of eval_order_dependence

Fixes #7624.

changelog: fix documentation of eval_order_dependence

2 years agoAuto merge of #88493 - chenyukang:fix-duplicated-diagnostic, r=estebank
bors [Mon, 6 Sep 2021 00:14:41 +0000 (00:14 +0000)]
Auto merge of #88493 - chenyukang:fix-duplicated-diagnostic, r=estebank

Fix #88256 remove duplicated diagnostics

Fix #88256

2 years agoAuto merge of #7596 - lengyijun:option_needless_deref, r=llogiq
bors [Sun, 5 Sep 2021 18:11:56 +0000 (18:11 +0000)]
Auto merge of #7596 - lengyijun:option_needless_deref, r=llogiq

New lint: option_needless_deref

changelog: [`option_needless_deref`]
fix #7571

2 years agoAuto merge of #7638 - xFrednet:7569-avoid-indexing-in-clippy, r=Manishearth
bors [Sun, 5 Sep 2021 17:01:50 +0000 (17:01 +0000)]
Auto merge of #7638 - xFrednet:7569-avoid-indexing-in-clippy, r=Manishearth

Avoid slice indexing in Clippy (down with the ICEs)

While working on #7569 I got about 23 lint reports where we can avoid slice indexing by destructing the slice early. This is a preparation PR to avoid fixing them in the lint PR. (The implementation already takes about 300 lines without tests :sweat_smile:). Either way, this should hopefully be easy to review :upside_down_face:

---

changelog: none

2 years agoAuto merge of #88499 - eddyb:layout-off, r=nagisa
bors [Sun, 5 Sep 2021 16:14:41 +0000 (16:14 +0000)]
Auto merge of #88499 - eddyb:layout-off, r=nagisa

Provide `layout_of` automatically (given tcx + param_env + error handling).

After #88337, there's no longer any uses of `LayoutOf` within `rustc_target` itself, so I realized I could move the trait to `rustc_middle::ty::layout` and redesign it a bit.

This is similar to #88338 (and supersedes it), but at no ergonomic loss, since there's no funky `C: LayoutOf<Ty = Ty>` -> `Ty: TyAbiInterface<C>` generic `impl` chain, and each `LayoutOf` still corresponds to one `impl` (of `LayoutOfHelpers`) for the specific context.

After this PR, this is what's needed to get `trait LayoutOf` (with the `layout_of` method) implemented on some context type:
* `TyCtxt`, via `HasTyCtxt`
* `ParamEnv`, via `HasParamEnv`
* a way to transform `LayoutError`s into the desired error type
  * an error type of `!` can be paired with having `cx.layout_of(...)` return `TyAndLayout` *without* `Result<...>` around it, such as used by codegen
  * this is done through a new `LayoutOfHelpers` trait (and so is specifying the type of `cx.layout_of(...)`)

When going through this path (and not bypassing it with a manual `impl` of `LayoutOf`), the end result is that only the error case can be customized, the query itself and the success paths are guaranteed to be uniform.

(**EDIT**: just noticed that because of the supertrait relationship, you cannot actually implement `LayoutOf` yourself, the blanket `impl` fully covers all possible context types that could ever implement it)

Part of the motivation for this shape of API is that I've been working on querifying `FnAbi::of_*`, and what I want/need to introduce for that looks a lot like the setup in this PR - in particular, it's harder to express the `FnAbi` methods in `rustc_target`, since they're much more tied to `rustc` concepts.

r? `@nagisa` cc `@oli-obk` `@bjorn3`

2 years agoAuto merge of #7627 - xFrednet:0000-updating-issue-templates-again, r=llogiq
bors [Sun, 5 Sep 2021 14:53:33 +0000 (14:53 +0000)]
Auto merge of #7627 - xFrednet:0000-updating-issue-templates-again, r=llogiq

Updating issue templates again for rustbot

It turns out that our current issue template can sometimes trigger a rustbot error message, as can be seen in [#7626](https://github.com/rust-lang/rust-clippy/issues/7626). I originally tested this in #7599, but it's apparently a bit inconsistent. This PR adds backticks to the commands, as correctly suggested by `@mikerite` in the comments. (Thank you!)

``@rustbot` label +S-blocked`

---

Now I also pushed a tiny link fix as well. :upside_down_face:

---

changelog: none

2 years agoAuto merge of #7629 - mikerite:fix-7623-2, r=xFrednet
bors [Sun, 5 Sep 2021 13:17:02 +0000 (13:17 +0000)]
Auto merge of #7629 - mikerite:fix-7623-2, r=xFrednet

Make `approx_const` MSRV aware

changelog: [`approx_const`]: Add MRSV checks for LOG10_2 and LOG2_10.

Fixes #7623

2 years agoAvoid slice indexing in Clippy (down with the ICEs)
xFrednet [Sat, 4 Sep 2021 16:21:49 +0000 (18:21 +0200)]
Avoid slice indexing in Clippy (down with the ICEs)

2 years agoImprove `approx_constant` output
Michael Wright [Sun, 5 Sep 2021 06:42:00 +0000 (08:42 +0200)]
Improve `approx_constant` output

2 years agoAdd MSRV to `approx_constant` documentation
Michael Wright [Sun, 5 Sep 2021 06:19:30 +0000 (08:19 +0200)]
Add MSRV to `approx_constant` documentation

2 years agoUpdate clippy_lints/src/needless_option_as_deref.rs
lyj [Sun, 5 Sep 2021 00:33:04 +0000 (08:33 +0800)]
Update clippy_lints/src/needless_option_as_deref.rs

Co-authored-by: llogiq <bogusandre@gmail.com>
2 years agoAuto merge of #7570 - HKalbasi:derivable-impls, r=camsteffen
bors [Sat, 4 Sep 2021 21:40:04 +0000 (21:40 +0000)]
Auto merge of #7570 - HKalbasi:derivable-impls, r=camsteffen

Add the `derivable_impls` lint

Fix #7550

changelog: Add new derivable_impls lint. mem_replace_with_default now covers non constructor cases.

2 years agoAuto merge of #7584 - shepmaster:unnecessary_expect, r=camsteffen
bors [Sat, 4 Sep 2021 21:25:55 +0000 (21:25 +0000)]
Auto merge of #7584 - shepmaster:unnecessary_expect, r=camsteffen

Extend unnecessary_unwrap to look for expect in addition to unwrap

changelog: Extend ``[`unnecessary_unwrap`]`` to also check for `Option::expect` and `Result::expect`. Also give code suggestions in some cases.

Fixes #7581

2 years agoadd derivable impls lint
hamidreza kalbasi [Mon, 16 Aug 2021 15:04:41 +0000 (19:34 +0430)]
add derivable impls lint

2 years agoneedless_option_as_deref
lengyijun [Tue, 24 Aug 2021 14:06:46 +0000 (22:06 +0800)]
needless_option_as_deref

2 years agoFix documentation of eval_order_dependence
chansuke [Sat, 4 Sep 2021 12:07:25 +0000 (21:07 +0900)]
Fix documentation of eval_order_dependence

2 years agoFix #88256, remove duplicated diagnostic
yukang [Sat, 4 Sep 2021 11:26:25 +0000 (19:26 +0800)]
Fix #88256, remove duplicated diagnostic

2 years agoCorrect link in documentation for the file `clippy_lints::utils::conf`
Fridtjof Stoldt [Fri, 3 Sep 2021 13:31:53 +0000 (15:31 +0200)]
Correct link in documentation for the file `clippy_lints::utils::conf`

2 years agoUpdating issue templates again for rustbot
xFrednet [Fri, 3 Sep 2021 10:12:16 +0000 (12:12 +0200)]
Updating issue templates again for rustbot

2 years agoMake `approx_const` MSRV aware
Michael Wright [Fri, 3 Sep 2021 06:34:34 +0000 (08:34 +0200)]
Make `approx_const` MSRV aware

Fixes #7623.

2 years agoReorder approx_consts constant to match rust docs
Michael Wright [Fri, 3 Sep 2021 04:41:30 +0000 (06:41 +0200)]
Reorder approx_consts constant to match rust docs

2 years agoAdjust the output of unnecessary_unwrap and provide a suggestion
Jake Goulding [Wed, 18 Aug 2021 20:33:50 +0000 (16:33 -0400)]
Adjust the output of unnecessary_unwrap and provide a suggestion

2 years agoExtend unnecessary_unwrap to look for expect in addition to unwrap
Jake Goulding [Wed, 18 Aug 2021 13:56:25 +0000 (09:56 -0400)]
Extend unnecessary_unwrap to look for expect in addition to unwrap

Closes #7581

2 years agoAuto merge of #88363 - michaelwoerister:remapped-diagnostics, r=estebank
bors [Fri, 3 Sep 2021 00:23:10 +0000 (00:23 +0000)]
Auto merge of #88363 - michaelwoerister:remapped-diagnostics, r=estebank

Path remapping: Make behavior of diagnostics output dependent on presence of --remap-path-prefix.

This PR fixes a regression (#87745) with `--remap-path-prefix` where the flag stopped causing diagnostic messages to be remapped as well. The regression was introduced in https://github.com/rust-lang/rust/pull/83813 where we erroneously assumed that remapping of diagnostic messages was not desired anymore (because #70642 partially undid that functionality with nobody objecting).

The issue is fixed by making `--remap-path-prefix` remap diagnostic messages again, including for paths that have been remapped in upstream crates (e.g. the standard library). This means that "sysroot-localization" (implemented in #70642) is also disabled if `rustc` is invoked with `--remap-path-prefix`. The assumption is that once someone starts explicitly remapping paths they also don't want paths to their local Rust installation in their build output.

In the future we might want to give more fine-grained control over this behavior via compiler flags (see https://github.com/rust-lang/rfcs/pull/3127 for a related RFC). For now this PR is intended as a regression fix.

This PR is an alternative to https://github.com/rust-lang/rust/pull/88191, which makes diagnostic messages be remapped unconditionally. That approach, however, would effectively revert #70642.

Fixes https://github.com/rust-lang/rust/issues/87745.

cc `@cbeuw`
r? `@ghost`

2 years agoAuto merge of #7604 - flip1995:rustup, r=Manishearth
bors [Thu, 2 Sep 2021 15:30:12 +0000 (15:30 +0000)]
Auto merge of #7604 - flip1995:rustup, r=Manishearth

Rustup

I'll write some TODOs later. This time I'll need a review for this Rustup

r? `@ghost`  (for now)

changelog: none

2 years agoFix fallout from re-applying patches
flip1995 [Thu, 2 Sep 2021 11:58:25 +0000 (12:58 +0100)]
Fix fallout from re-applying patches

2 years agoBump nightly version -> 2021-09-02
flip1995 [Thu, 2 Sep 2021 11:45:45 +0000 (12:45 +0100)]
Bump nightly version -> 2021-09-02

2 years agoFix matadata collection configuration formatting
xFrednet [Sat, 28 Aug 2021 13:04:28 +0000 (15:04 +0200)]
Fix matadata collection configuration formatting

2 years agoAdd higher docs and remove some unneeded fields
Cameron Steffen [Fri, 27 Aug 2021 13:38:07 +0000 (08:38 -0500)]
Add higher docs and remove some unneeded fields

2 years agoFix remaining dogfood errors
flip1995 [Thu, 26 Aug 2021 15:53:07 +0000 (16:53 +0100)]
Fix remaining dogfood errors

Except for the missing docs ones

2 years agoFix dogfood
Cameron Steffen [Thu, 26 Aug 2021 15:25:14 +0000 (10:25 -0500)]
Fix dogfood

2 years agoFix manual_match with let-expressions
Cameron Steffen [Thu, 26 Aug 2021 15:05:33 +0000 (10:05 -0500)]
Fix manual_match with let-expressions

2 years agoMerge remote-tracking branch 'upstream/master' into rustup2
flip1995 [Thu, 2 Sep 2021 11:38:17 +0000 (12:38 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup2

2 years agoAuto merge of #7619 - UnrealApex:patch-1, r=flip1995
bors [Thu, 2 Sep 2021 08:11:57 +0000 (08:11 +0000)]
Auto merge of #7619 - UnrealApex:patch-1, r=flip1995

Update README.md

Capitalized proper noun.
changelog:none

2 years agoAuto merge of #7617 - xFrednet:0000-link-diag-item-docs, r=giraffate
bors [Thu, 2 Sep 2021 01:04:40 +0000 (01:04 +0000)]
Auto merge of #7617 - xFrednet:0000-link-diag-item-docs, r=giraffate

Reference new diagnostic item docs in our docs :)

The title says it all. The rustc dev guide now has some information about diagnostic items that are worthwhile linking to :upside_down_face:

---

changelog: none

2 years agorustc_target: move `LayoutOf` to `ty::layout`.
Eduard-Mihai Burtescu [Mon, 30 Aug 2021 14:38:27 +0000 (17:38 +0300)]
rustc_target: move `LayoutOf` to `ty::layout`.

2 years agoUpdate README.md
Aaron [Wed, 1 Sep 2021 21:04:24 +0000 (14:04 -0700)]
Update README.md

2 years agoReference new diagnostic item docs in our docs :)
xFrednet [Wed, 1 Sep 2021 19:55:08 +0000 (21:55 +0200)]
Reference new diagnostic item docs in our docs :)

2 years agoAuto merge of #7605 - xordi:issue-7548-fix, r=giraffate
bors [Tue, 31 Aug 2021 13:36:20 +0000 (13:36 +0000)]
Auto merge of #7605 - xordi:issue-7548-fix, r=giraffate

Issue 7548 fix

Close #7548

changelog: [`bool_assert_comparison`] fixes should be emitted only in case they are comparing a value of a type that implements the `Not` trait with an output of type `bool` against a boolean literal.

2 years agoFix function and variable names
xordi [Tue, 31 Aug 2021 07:06:14 +0000 (09:06 +0200)]
Fix function and variable names

2 years agoFix CI errors
xordi [Thu, 26 Aug 2021 16:18:17 +0000 (18:18 +0200)]
Fix CI errors

2 years agoAdd new ui tests
xordi [Thu, 26 Aug 2021 14:15:04 +0000 (16:15 +0200)]
Add new ui tests

2 years agoCheck for Not trait implementation
xordi [Thu, 26 Aug 2021 14:14:37 +0000 (16:14 +0200)]
Check for Not trait implementation

2 years agoFix clippy for let-else
Cameron Steffen [Sun, 25 Jul 2021 23:27:44 +0000 (18:27 -0500)]
Fix clippy for let-else

2 years agoAuto merge of #7573 - Jarcho:option_if_let_else, r=giraffate
bors [Mon, 30 Aug 2021 13:57:21 +0000 (13:57 +0000)]
Auto merge of #7573 - Jarcho:option_if_let_else, r=giraffate

Fix `option_if_let_else`

fixes: #5822
fixes: #6737
fixes: #7567

The inference from #6137 still exists so I'm not sure if this should be moved from the nursery. Before doing that though I'd almost want to see this split into two lints. One suggesting `map_or` and the other suggesting `map_or_else`.

`map_or_else` tends to have longer expressions for both branches so it doesn't end up much shorter than a match expression in practice. It also seems most people find it harder to read. `map_or` at least has the terseness benefit of being on one line most of the time, especially when the `None` branch is just a literal or path expression.

changelog: `break` and `continue` statments local to the would-be closure are allowed in `option_if_let_else`
changelog: don't lint in const contexts  in `option_if_let_else`
changelog: don't lint when yield expressions are used  in `option_if_let_else`
changelog: don't lint when the captures made by the would-be closure conflict with the other branch  in `option_if_let_else`
changelog: don't lint when a field of a local is used when the type could be pontentially moved from  in `option_if_let_else`
changelog: in some cases, don't lint when scrutinee expression conflicts with the captures of the would-be closure  in `option_if_let_else`

2 years ago`feature(const_generics)` -> `feature(const_param_types)`
lcnr [Fri, 27 Aug 2021 16:04:57 +0000 (18:04 +0200)]
`feature(const_generics)` -> `feature(const_param_types)`

2 years agorename const_evaluatable_checked to generic_const_exprs
Ellen [Wed, 25 Aug 2021 09:21:39 +0000 (10:21 +0100)]
rename const_evaluatable_checked to generic_const_exprs

:sparkles:

2 years agoTeach tools that macros are now HIR items
inquisitivecrystal [Thu, 5 Aug 2021 23:58:46 +0000 (16:58 -0700)]
Teach tools that macros are now HIR items

2 years agoTreat macros as HIR items
inquisitivecrystal [Sat, 31 Jul 2021 06:50:57 +0000 (23:50 -0700)]
Treat macros as HIR items

2 years agoAuto merge of #7600 - xFrednet:0000-update-issue-templates, r=camsteffen
bors [Fri, 27 Aug 2021 15:42:09 +0000 (15:42 +0000)]
Auto merge of #7600 - xFrednet:0000-update-issue-templates, r=camsteffen

Updated issue templates(formatting and rustbot label reference)

This PR updates our issue templates. The changes are:

1. **Make the *Meta* section smaller and not indented**

    The current format sometimes gets messed up when a user simply pasts the rustc version into the issue without indenting it to match the code block. Removing the indention should hopefully help with formatting in the future.

    <details><summary>Example of messed up formatting </summary>

    ![image](https://user-images.githubusercontent.com/17087237/130811809-2b9bc58e-c13f-4338-b34e-18648a5de413.png)

    </details>

    Additionally, I've removed the Version of Clippy from the template. Every issue that I have seen had matching rustc and Clippy versions, and just asking for `rustc -Vv` makes the issue look cleaner IMO.

2. **Add a comment explaining how additional labels can be added with ``@rustbot` label +<label>`. The explanation looks like this:**

    ```
    <!--
    Additional labels can be added to this issue by including the following command:

    `@rustbot` label +<label>

    Common labels for this issue type are:
    * `I-suggestion-causes-error`
    -->
    ```

    The example ``@rustbot`` call can sadly not be marked as code inside a comment block. But the example will not cause the bot to add any labels. See rust-lang/rust-clippy#7599

---

changelog: none

cc: `@rust-lang/clippy`

2 years agoPath remapping: Make behavior of diagnostics output dependent on presence of --remap...
Michael Woerister [Thu, 26 Aug 2021 10:46:01 +0000 (12:46 +0200)]
Path remapping: Make behavior of diagnostics output dependent on presence of --remap-path-prefix.

2 years agoSmall cleanup of `option_if_let_else` and additional tests.
Jason Newcomb [Thu, 26 Aug 2021 15:27:43 +0000 (11:27 -0400)]
Small cleanup of `option_if_let_else` and additional tests.

2 years agoAuto merge of #7602 - flip1995:needless_collect_appl, r=xFrednet
bors [Thu, 26 Aug 2021 11:42:47 +0000 (11:42 +0000)]
Auto merge of #7602 - flip1995:needless_collect_appl, r=xFrednet

Set applicability of needless_collect to MaybeIncorrect

Fixes rust-lang/rust#88333

changelog: Set applicability of [`needless_collect`] to MaybeIncorrect

2 years agoAuto merge of #7583 - dswij:match-trait-docs, r=xFrednet
bors [Thu, 26 Aug 2021 10:04:12 +0000 (10:04 +0000)]
Auto merge of #7583 - dswij:match-trait-docs, r=xFrednet

Tweak common tool docs on type-implement-trait check

See https://github.com/rust-lang/rust-clippy/pull/7562#issuecomment-898240963.

changelog: none

2 years agoUpdate doc/common_tools_writing_lints.md
dswij [Thu, 26 Aug 2021 10:01:41 +0000 (18:01 +0800)]
Update doc/common_tools_writing_lints.md

Add missing import `paths` for the doc example.

Co-authored-by: Fridtjof Stoldt <xFrednet@gmail.com>