]> git.lizzy.rs Git - rust.git/log
rust.git
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>
2 years agoUpdate common tool docs on type implement trait check
dswij [Wed, 18 Aug 2021 04:40:59 +0000 (12:40 +0800)]
Update common tool docs on type implement trait check

Common tool documentation uses `match_trait_method` which is deprecated.
Additionally, adds information on why `is_trait_method` is not the
preferred way.

2 years agoSet applicability of needless_collect to MaybeIncorrect
flip1995 [Thu, 26 Aug 2021 09:01:11 +0000 (10:01 +0100)]
Set applicability of needless_collect to MaybeIncorrect

2 years agoupdate `TypeFlags` to deal with missing ct substs
lcnr [Sat, 17 Jul 2021 16:48:07 +0000 (18:48 +0200)]
update `TypeFlags` to deal with missing ct substs

2 years agoadd `tcx` to `fn walk`
lcnr [Sat, 17 Jul 2021 14:43:23 +0000 (16:43 +0200)]
add `tcx` to `fn walk`

2 years agomake unevaluated const substs optional
lcnr [Mon, 15 Mar 2021 23:05:45 +0000 (00:05 +0100)]
make unevaluated const substs optional

2 years agorequire a `tcx` for `TypeVisitor`
lcnr [Sat, 13 Mar 2021 15:05:15 +0000 (16:05 +0100)]
require a `tcx` for `TypeVisitor`

2 years agoAuto merge of #7543 - DevinR528:disallowed-mod, r=Manishearth
bors [Wed, 25 Aug 2021 15:20:28 +0000 (15:20 +0000)]
Auto merge of #7543 - DevinR528:disallowed-mod, r=Manishearth

Add module_style lint to style

changelog: Add new [`module_style`] style lint

This is a configurable (no mod file/mod file) lint that determines if `mod.rs` is used consistently or if `mod.rs` is never used (using the new mod layout).

2 years agoUpdated issue templates(formatting and rustbot label reference)
xFrednet [Wed, 25 Aug 2021 14:25:01 +0000 (16:25 +0200)]
Updated issue templates(formatting and rustbot label reference)

2 years agoAuto merge of #7453 - F3real:assume_function_calls_have_side_effect, r=flip1995
bors [Wed, 25 Aug 2021 08:31:20 +0000 (08:31 +0000)]
Auto merge of #7453 - F3real:assume_function_calls_have_side_effect, r=flip1995

Don't report function calls as unnecessary operation if used in array index

Attempts to fix: #7412

changelog: Don't report function calls used in indexing as unnecessary operation. [`unnecessary_operation`]

2 years agoAdd module_style lint to restriction
Devin Ragotzy [Fri, 30 Jul 2021 21:28:44 +0000 (17:28 -0400)]
Add module_style lint to restriction

Add tests for disallowed_mod in ui-cargo test section

Use correct algorithm to determine if mod.rs is missing

Move to two lints and remove config option

Switch lint names so they read "warn on ..."

Emit the same help info for self_named_mod_file warnings

Bail when both lints are Allow

Reword help message for both module_style lints

2 years agoAuto merge of #7592 - lengyijun:redundant_allocation, r=camsteffen
bors [Tue, 24 Aug 2021 12:32:01 +0000 (12:32 +0000)]
Auto merge of #7592 - lengyijun:redundant_allocation, r=camsteffen

redundant_allocation: fix 7487

Fixes #7487

changelog: [`redundant_allocation`] - allow `Box<Box<dyn T>>` which replaces wide pointers with thin pointers

2 years agoredundant_allocation: fix 7487
lengyijun [Sun, 22 Aug 2021 07:22:28 +0000 (15:22 +0800)]
redundant_allocation: fix 7487

2 years agoAuto merge of #83302 - camsteffen:write-piece-unchecked, r=dtolnay
bors [Mon, 23 Aug 2021 22:55:19 +0000 (22:55 +0000)]
Auto merge of #83302 - camsteffen:write-piece-unchecked, r=dtolnay

Get piece unchecked in `write`

We already use specialized `zip`, but it seems like we can do a little better by not checking `pieces` length at all.

`Arguments` constructors are now unsafe. So the `format_args!` expansion now includes an `unsafe` block.

<details>
<summary>Local Bench Diff</summary>

```text
 name                        before ns/iter  after ns/iter  diff ns/iter   diff %  speedup
 fmt::write_str_macro1       22,967          19,718               -3,249  -14.15%   x 1.16
 fmt::write_str_macro2       35,527          32,654               -2,873   -8.09%   x 1.09
 fmt::write_str_macro_debug  571,953         575,973               4,020    0.70%   x 0.99
 fmt::write_str_ref          9,579           9,459                  -120   -1.25%   x 1.01
 fmt::write_str_value        9,573           9,572                    -1   -0.01%   x 1.00
 fmt::write_u128_max         176             173                      -3   -1.70%   x 1.02
 fmt::write_u128_min         138             134                      -4   -2.90%   x 1.03
 fmt::write_u64_max          139             136                      -3   -2.16%   x 1.02
 fmt::write_u64_min          129             135                       6    4.65%   x 0.96
 fmt::write_vec_macro1       24,401          22,273               -2,128   -8.72%   x 1.10
 fmt::write_vec_macro2       37,096          35,602               -1,494   -4.03%   x 1.04
 fmt::write_vec_macro_debug  588,291         589,575               1,284    0.22%   x 1.00
 fmt::write_vec_ref          9,568           9,732                   164    1.71%   x 0.98
 fmt::write_vec_value        9,516           9,625                   109    1.15%   x 0.99
```
</details>

2 years agoAuto merge of #7595 - camsteffen:branches-sharing-nursery, r=Manishearth
bors [Mon, 23 Aug 2021 19:18:09 +0000 (19:18 +0000)]
Auto merge of #7595 - camsteffen:branches-sharing-nursery, r=Manishearth

Move branches_sharing_code to nursery

changelog: Move [`branches_sharing_code`] to nursery

...since there are quite a few [open bugs](https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+is%3Aopen+branches_sharing_code).

2 years agoRollup merge of #88230 - steffahn:a_an, r=oli-obk
Mara Bos [Mon, 23 Aug 2021 18:45:49 +0000 (20:45 +0200)]
Rollup merge of #88230 - steffahn:a_an, r=oli-obk

Fix typos “a”→“an”

Fix typos in comments; found using a regex to find some easy instance of incorrect usage of a vs. an.

While automation was used to find these, every change was checked manually.

Changes in submodules get separate PRs:
* https://github.com/rust-lang/stdarch/pull/1201
* https://github.com/rust-lang/cargo/pull/9821
* https://github.com/rust-lang/miri/pull/1874
* https://github.com/rust-lang/rls/pull/1746
* https://github.com/rust-analyzer/rust-analyzer/pull/9984
  _folks @ rust-analyzer are fast at merging…_
  * https://github.com/rust-analyzer/rust-analyzer/pull/9985
  * https://github.com/rust-analyzer/rust-analyzer/pull/9987
  * https://github.com/rust-analyzer/rust-analyzer/pull/9989

_For `clippy`, I don’t know if the changes should better better be moved to a PR to the original repo._

<hr>

This has some overlap with #88226, but neither is a strict superset of the other.

If you want multiple commits, I can split it up; in that case, make sure to suggest a criterion for splitting.

2 years agoMove branches_sharing_code to nursery
Cameron Steffen [Mon, 23 Aug 2021 18:39:36 +0000 (13:39 -0500)]
Move branches_sharing_code to nursery

2 years agoAuto merge of #7593 - camsteffen:remove-stderr-limit, r=Manishearth
bors [Mon, 23 Aug 2021 16:14:50 +0000 (16:14 +0000)]
Auto merge of #7593 - camsteffen:remove-stderr-limit, r=Manishearth

Remove stderr limit

changelog: none

Discussed at https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Increase.20test.20stderr.20length.20limit.3F

2 years agoRemove stderr limit
Cameron Steffen [Mon, 23 Aug 2021 15:58:56 +0000 (10:58 -0500)]
Remove stderr limit

2 years agoAuto merge of #7539 - Labelray:master, r=camsteffen
bors [Mon, 23 Aug 2021 13:56:18 +0000 (13:56 +0000)]
Auto merge of #7539 - Labelray:master, r=camsteffen

Add new lint `negative_feature_names` and `redundant_feature_names`

Add new lint [`negative_feature_names`] to detect feature names with prefixes `no-` or `not-` and new lint [`redundant_feature_names`] to detect feature names with prefixes `use-`, `with-` or suffix `-support`
changelog: Add new lint [`negative_feature_names`] and [`redundant_feature_names`]

2 years agoAdd new lints `negative_feature_names` and `redundant_feature_names`
Labelray [Fri, 6 Aug 2021 14:46:20 +0000 (22:46 +0800)]
Add new lints `negative_feature_names` and `redundant_feature_names`

2 years agoRollup merge of #88211 - petrochenkov:withhilo, r=jyn514
Guillaume Gomez [Sun, 22 Aug 2021 18:52:54 +0000 (20:52 +0200)]
Rollup merge of #88211 - petrochenkov:withhilo, r=jyn514

cleanup: `Span::new` -> `Span::with_lo`

Extracted from https://github.com/rust-lang/rust/pull/84373 as suggested in https://github.com/rust-lang/rust/pull/84373#issuecomment-857773867.
It turned out less useful then I expected, but anyway.
r? `@cjgillot`
`@bors` rollup

2 years agoFix typos “an”→“a” and a few different ones that appeared in the same search
Frank Steffahn [Sun, 22 Aug 2021 16:15:49 +0000 (18:15 +0200)]
Fix typos “an”→“a” and a few different ones that appeared in the same search

2 years agoFix more “a”/“an” typos
Frank Steffahn [Sun, 22 Aug 2021 15:27:18 +0000 (17:27 +0200)]
Fix more “a”/“an” typos

2 years agoFix typos “a”→“an”
Frank Steffahn [Sun, 22 Aug 2021 12:46:15 +0000 (14:46 +0200)]
Fix typos “a”→“an”

2 years agoAuto merge of #88163 - camsteffen:collapsible-match-fix, r=Manishearth
bors [Sun, 22 Aug 2021 13:26:32 +0000 (13:26 +0000)]
Auto merge of #88163 - camsteffen:collapsible-match-fix, r=Manishearth

Fix clippy::collapsible_match with let expressions

This fixes rust-lang/rust-clippy#7575 which is a regression from #80357. I am fixing the bug here instead of in the clippy repo (if that's okay) because a) the regression has not been synced yet and b) I would like to land the fix on nightly asap.

The fix is basically to re-generalize `match` and `if let` for the lint implementation (they were split because `if let` no longer desugars to `match` in the HIR).

Also fixes rust-lang/rust-clippy#7586 and fixes rust-lang/rust-clippy#7591
cc `@rust-lang/clippy`
`@xFrednet` do you want to review this?

2 years agocleanup: `Span::new` -> `Span::with_lo`
Vadim Petrochenkov [Sat, 21 Aug 2021 15:07:21 +0000 (18:07 +0300)]
cleanup: `Span::new` -> `Span::with_lo`

2 years agointroduce a Coerce predicate
Niko Matsakis [Sat, 21 Nov 2020 12:06:16 +0000 (07:06 -0500)]
introduce a Coerce predicate

2 years agoFix clippy let expressions fallout
Cameron Steffen [Thu, 19 Aug 2021 18:31:25 +0000 (13:31 -0500)]
Fix clippy let expressions fallout