]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAuto merge of #6823 - Jarcho:diagnostic_items, r=phansch
bors [Sun, 7 Mar 2021 12:04:42 +0000 (12:04 +0000)]
Auto merge of #6823 - Jarcho:diagnostic_items, r=phansch

Use diagnostic or language items instead of paths

I think that gets everything except ones used in a list of paths to check.

changelog: none

3 years agoUse `LanguageItems::require`
Jason Newcomb [Tue, 2 Mar 2021 18:06:30 +0000 (13:06 -0500)]
Use `LanguageItems::require`

3 years agoAuto merge of #6854 - mgacek8:6844_fix_doc_for_useless_format_lint, r=phansch
bors [Sat, 6 Mar 2021 13:32:04 +0000 (13:32 +0000)]
Auto merge of #6854 - mgacek8:6844_fix_doc_for_useless_format_lint, r=phansch

useless_format: fix examples in the description

fixes #6844
changelog: useless_format: fix examples in the description

3 years agoAuto merge of #6848 - matthiaskrgr:lintcheck_clippyfix, r=llogiq
bors [Fri, 5 Mar 2021 21:10:52 +0000 (21:10 +0000)]
Auto merge of #6848 - matthiaskrgr:lintcheck_clippyfix, r=llogiq

lintcheck: add --fix mode which tries to apply lint suggestions to th…

…e sources and prints a warning if that fails

Great for spotting false positives/broken suggestions of applicable lints.

There are false positives though because I'm not sure yet how to silence rustc warnings while keeping clippy warnings.
Sometimes rustc makes a suggestion that fails to apply and the implementation does not differentiate between clippy and rustc warnings when applying lint suggestions.

changelog: none

3 years agouseless_format: fix examples in the description
Mateusz Gacek [Fri, 5 Mar 2021 20:11:31 +0000 (12:11 -0800)]
useless_format: fix examples in the description

"Good" example was something not acceptable by the useless_format lint.

3 years agoAuto merge of #6852 - camsteffen:avoid-mir, r=Manishearth
bors [Fri, 5 Mar 2021 17:30:43 +0000 (17:30 +0000)]
Auto merge of #6852 - camsteffen:avoid-mir, r=Manishearth

Remove a couple MIR usages

changelog: none

We use MIR to get the return type of a closure/function in a couple places. But typeck seems like a better approach.

This is the easy part of #6080.

Also did a tiny cleanup with `typeck` -> `typeck_body`.

3 years agoUse typeck_body
Cameron Steffen [Fri, 5 Mar 2021 16:35:39 +0000 (10:35 -0600)]
Use typeck_body

3 years agoAvoid mir in missing_errors_doc
Cameron Steffen [Fri, 5 Mar 2021 16:32:15 +0000 (10:32 -0600)]
Avoid mir in missing_errors_doc

3 years agoAvoid mir in implicit_return
Cameron Steffen [Fri, 5 Mar 2021 16:13:59 +0000 (10:13 -0600)]
Avoid mir in implicit_return

3 years agolintcheck: add --fix mode which tries to apply lint suggestions to the sources and...
Matthias Krüger [Fri, 5 Mar 2021 08:30:12 +0000 (09:30 +0100)]
lintcheck: add --fix mode which tries to apply lint suggestions to the sources and prints a warning if that fails

Great for spotting false positives/broken suggestions of applicable lints.

There are false positives though becasue I'm not sure yet how to silence rustc warnings while keeping clippy warnings.
Sometimes rustc makes a suggestion that fails to apply and the implementation does not differenciate between clippy and rustc warnings when applying lint suggestions.

changelog: none

3 years agoAuto merge of #6849 - flip1995:dogfood-fix, r=matthiaskrgr
bors [Fri, 5 Mar 2021 14:09:24 +0000 (14:09 +0000)]
Auto merge of #6849 - flip1995:dogfood-fix, r=matthiaskrgr

Dogfood and CI fixes

The CI fix is practically #6829 rebased and squashed into one commit

Dogfood fix is a follow up of #6802

r? `@matthiaskrgr` for lintcheck changes

(best reviewed with whitespace changes hidden)

changelog: none

3 years agoExtract directory creation into its own function
flip1995 [Fri, 5 Mar 2021 13:06:43 +0000 (14:06 +0100)]
Extract directory creation into its own function

3 years agoFix dogfood errors in clippy_dev
flip1995 [Fri, 5 Mar 2021 10:10:15 +0000 (11:10 +0100)]
Fix dogfood errors in clippy_dev

3 years agoFix dogfood errors in clippy_lints
flip1995 [Fri, 5 Mar 2021 10:08:25 +0000 (11:08 +0100)]
Fix dogfood errors in clippy_lints

3 years agoRemove hack that forces dogfood to run on nightly
flip1995 [Fri, 5 Mar 2021 09:31:21 +0000 (10:31 +0100)]
Remove hack that forces dogfood to run on nightly

This isn't necessary anymore, since we don't use a custom toolchain anymore

3 years agoFix dogfood test
flip1995 [Fri, 5 Mar 2021 09:30:26 +0000 (10:30 +0100)]
Fix dogfood test

Since clippy cannot be a workspace, we have to check the sub-crates separately

3 years agoci: Sync clippy and clippy_bors workflows
flip1995 [Fri, 5 Mar 2021 09:27:30 +0000 (10:27 +0100)]
ci: Sync clippy and clippy_bors workflows

Those workflows should always test exactly the same things

3 years agoAuto merge of #6846 - matthiaskrgr:lintcheck_test, r=Manishearth
bors [Thu, 4 Mar 2021 23:28:50 +0000 (23:28 +0000)]
Auto merge of #6846 - matthiaskrgr:lintcheck_test, r=Manishearth

lintcheck: add test (but don't run on ci)

This is the rest of https://github.com/rust-lang/rust-clippy/pull/6829 but without adding anything to ci

*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog: none

3 years agoupdate lintcheck logs
Matthias Krüger [Thu, 4 Mar 2021 21:40:04 +0000 (22:40 +0100)]
update lintcheck logs

3 years agolintcheck: add test
Matthias Krüger [Thu, 4 Mar 2021 21:33:22 +0000 (22:33 +0100)]
lintcheck: add test

3 years agoAuto merge of #6843 - Jarcho:match_on_same_arms_macro, r=Manishearth
bors [Thu, 4 Mar 2021 18:23:39 +0000 (18:23 +0000)]
Auto merge of #6843 - Jarcho:match_on_same_arms_macro, r=Manishearth

Compare empty blocks for equality based on tokens

fixes: #1390

This only considers empty blocks for now, though we should also catch something like this:

```rust
match 0 {
    0 => {
        do_something();
        trace!(0);
        0
    }
    1 => {
        do_something();
        trace!(1);
        1
    }
    x => x,
}
```

As far as I can tell there aren't any negative effects on other lints. These blocks only happen to be the same for a given compilation, not all compilations.

changelog: Fix `match_on_same_arms` and others. Only consider empty blocks equal if the tokens contained are the same.

3 years agoAuto merge of #6833 - daxpedda:use-self, r=Manishearth
bors [Thu, 4 Mar 2021 17:35:06 +0000 (17:35 +0000)]
Auto merge of #6833 - daxpedda:use-self, r=Manishearth

Fix false-positive in `use_self`

Fixes  #6818.

changelog: Fix false positives for use_self in macros.

3 years agoWhen checking if two empty hir blocks are equal also check to see if the tokens used...
Jason Newcomb [Thu, 4 Mar 2021 16:06:24 +0000 (11:06 -0500)]
When checking if two empty hir blocks are equal also check to see if the tokens used are the same as well

3 years agoAuto merge of #6839 - matthiaskrgr:lintcheck_clippy_warnings, r=flip1995
bors [Thu, 4 Mar 2021 11:43:05 +0000 (11:43 +0000)]
Auto merge of #6839 - matthiaskrgr:lintcheck_clippy_warnings, r=flip1995

lintcheck: fix clippy warnings

split out from https://github.com/rust-lang/rust-clippy/pull/6829
changelog: none

3 years agolintcheck: fix clippy warnings
Matthias Krüger [Tue, 2 Mar 2021 19:20:51 +0000 (20:20 +0100)]
lintcheck: fix clippy warnings

3 years agoAuto merge of #6825 - djc:naive-bytecount-pedantic, r=Manishearth
bors [Wed, 3 Mar 2021 21:26:24 +0000 (21:26 +0000)]
Auto merge of #6825 - djc:naive-bytecount-pedantic, r=Manishearth

Move naive_bytecount to pedantic

As discussed on Zulip, current best practice is to avoid recommending
external crates. This lint is from before that was enforced. Move it
to the pedantic group to avoid enabling it by default.

https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/naive_bytecount.20suggesting.20extra.20dependency

changelog: move [`naive_bytecount`] to pedantic

3 years agoFix false-positive in `use_self`
daxpedda [Wed, 3 Mar 2021 16:32:49 +0000 (17:32 +0100)]
Fix false-positive in `use_self`

3 years agoAuto merge of #6824 - Y-Nak:refactor_loops_module, r=flip1995
bors [Wed, 3 Mar 2021 10:34:22 +0000 (10:34 +0000)]
Auto merge of #6824 - Y-Nak:refactor_loops_module, r=flip1995

Refactor: organize loops file into loops module (Delegated)

`@flip1995` `@nahuakang`

closes #6693
r? `@flip1995`

 As we talked about in the PM of Zulip,  this PR is a delegated PR from `@nahuakang.`

Changes from the last commit of #6693:
1. Unify the name of the main entries of all modules to check, that was pointed out [here](https://github.com/rust-lang/rust-clippy/pull/6693#discussion_r582897713)
2. Simplify ` check_for_loop_arg`, that was pointed out [here](https://github.com/rust-lang/rust-clippy/pull/6693#discussion_r582914044) and [here](https://github.com/rust-lang/rust-clippy/pull/6693#discussion_r582929910)
3. Resolve conflicts

changelog: Refactor `loops.rs` file into `loops` module.

3 years agoAuto merge of #6801 - Jarcho:manual_match_fix, r=phansch
bors [Tue, 2 Mar 2021 15:36:00 +0000 (15:36 +0000)]
Auto merge of #6801 - Jarcho:manual_match_fix, r=phansch

Fix `manual_map` false positives

fixes: #6795
fixes: #6797
fixes: #6811
fixes: #6819

changelog: Fix false positives for `manual_map` when `return`, `break`, `continue`, `yield`, `await`, and partially moved values are used.
changelog: Don't expand macros in suggestions  for `manual_map`

3 years agoMove naive_bytecount to pedantic
Dirkjan Ochtman [Tue, 2 Mar 2021 13:26:23 +0000 (14:26 +0100)]
Move naive_bytecount to pedantic

As discussed on Zulip, current best practice is to avoid recommending
external crates. This lint is from before that was enforced. Move it
to the pedantic group to avoid enabling it by default.

https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/naive_bytecount.20suggesting.20extra.20dependency

3 years agoRemove "for_loop_arg.rs"
Yoshitomo Nakanishi [Tue, 2 Mar 2021 12:09:04 +0000 (21:09 +0900)]
Remove "for_loop_arg.rs"

3 years agoAuto merge of #6791 - TaKO8Ki:iter-count, r=matthiaskrgr
bors [Tue, 2 Mar 2021 11:31:43 +0000 (11:31 +0000)]
Auto merge of #6791 - TaKO8Ki:iter-count, r=matthiaskrgr

New lint: `iter_count`

This pull request adds a new lint named `iter_count`.

---

closes https://github.com/rust-lang/rust-clippy/issues/6262

changelog: new lint `iter_count`

3 years agoAuto merge of #6716 - magurotuna:refactor-transmute-mod, r=flip1995
bors [Tue, 2 Mar 2021 09:44:03 +0000 (09:44 +0000)]
Auto merge of #6716 - magurotuna:refactor-transmute-mod, r=flip1995

Refactor: arrange transmute lints

This PR arranges `transmute` lints so that they can be accessed more easily.
Basically, I followed the instruction described in #6680 as to how to do the refactoring.

- `declare_clippy_lint!` and `impl LintPass` is placed in `transmute/mod.rs`
- Uitlity functions is placed in `transmute/utils.rs`
- Each lint function about `transmute` is moved into its own module, like `transmute/useless_transmute.rs`

For ease of review, I refactored step by step, keeping each commit small. For instance, all I did in
2451781 was to move  `useless_transmute` into its own module.

---

changelog: Refactor `transmute.rs` file into `transmute` module.

3 years agoMake check_cast private
Yusuke Tanaka [Wed, 10 Feb 2021 16:42:12 +0000 (01:42 +0900)]
Make check_cast private

3 years agoRefactor calls to lint check functions
Yusuke Tanaka [Wed, 10 Feb 2021 16:41:52 +0000 (01:41 +0900)]
Refactor calls to lint check functions

3 years agoCleanup imports
Yusuke Tanaka [Wed, 10 Feb 2021 16:29:45 +0000 (01:29 +0900)]
Cleanup imports

3 years agoMove transmutes_expressible_as_ptr_casts to its own module
Yusuke Tanaka [Wed, 10 Feb 2021 16:27:44 +0000 (01:27 +0900)]
Move transmutes_expressible_as_ptr_casts to its own module

3 years agoMove unsound_collection_transmute to its own module
Yusuke Tanaka [Wed, 10 Feb 2021 16:21:38 +0000 (01:21 +0900)]
Move unsound_collection_transmute to its own module

3 years agoMove transmute_float_to_int to its own module
Yusuke Tanaka [Wed, 10 Feb 2021 16:08:48 +0000 (01:08 +0900)]
Move transmute_float_to_int to its own module

3 years agoMove transmute_int_to_float to its own module
Yusuke Tanaka [Wed, 10 Feb 2021 16:03:08 +0000 (01:03 +0900)]
Move transmute_int_to_float to its own module

3 years agoMove transmute_int_to_bool to its own module
Yusuke Tanaka [Wed, 10 Feb 2021 15:55:32 +0000 (00:55 +0900)]
Move transmute_int_to_bool to its own module

3 years agoMove transmute_ptr_to_ptr to its own module
Yusuke Tanaka [Wed, 10 Feb 2021 15:50:09 +0000 (00:50 +0900)]
Move transmute_ptr_to_ptr to its own module

3 years agoMove transmute_bytes_to_str and transmute_ptr_to_ptr to transmute_ref_to_ref module
Yusuke Tanaka [Wed, 10 Feb 2021 15:40:57 +0000 (00:40 +0900)]
Move transmute_bytes_to_str and transmute_ptr_to_ptr to transmute_ref_to_ref module

3 years agoMove transmute_int_to_char to its own module
Yusuke Tanaka [Wed, 10 Feb 2021 15:18:45 +0000 (00:18 +0900)]
Move transmute_int_to_char to its own module

3 years agoMove transmute_ptr_to_ref to its own module
Yusuke Tanaka [Wed, 10 Feb 2021 15:10:19 +0000 (00:10 +0900)]
Move transmute_ptr_to_ref to its own module

3 years agoMove crosspointer_transmute to its own module
Yusuke Tanaka [Wed, 10 Feb 2021 15:02:21 +0000 (00:02 +0900)]
Move crosspointer_transmute to its own module

3 years agoMove wrong_transmute to its own module
Yusuke Tanaka [Wed, 10 Feb 2021 14:57:56 +0000 (23:57 +0900)]
Move wrong_transmute to its own module

3 years agoMove useless_transmute to its own module
Yusuke Tanaka [Wed, 10 Feb 2021 14:54:11 +0000 (23:54 +0900)]
Move useless_transmute to its own module

3 years agoAdd transmute/utils.rs
Yusuke Tanaka [Wed, 10 Feb 2021 14:15:06 +0000 (23:15 +0900)]
Add transmute/utils.rs

3 years agoCreate transmute directory
Yusuke Tanaka [Wed, 10 Feb 2021 13:59:08 +0000 (22:59 +0900)]
Create transmute directory

3 years agoSimplify check_for_loop_arg
Yoshitomo Nakanishi [Tue, 2 Mar 2021 03:41:06 +0000 (12:41 +0900)]
Simplify check_for_loop_arg

3 years agoUnify names of lint entry functions in loops to 'check'
Yoshitomo Nakanishi [Tue, 2 Mar 2021 02:49:14 +0000 (11:49 +0900)]
Unify names of lint entry functions in loops to 'check'

3 years agoInclude loops.rs changes from PR#6698
nahuakang [Mon, 22 Feb 2021 15:24:25 +0000 (16:24 +0100)]
Include loops.rs changes from PR#6698

3 years agoClean up: Rename some files to be consistent with lint names; import lints to each...
nahuakang [Sun, 21 Feb 2021 17:25:50 +0000 (18:25 +0100)]
Clean up: Rename some files to be consistent with lint names; import lints to each file

3 years agoMove check_for_loop_arg back to mod; split into 4 lint files
nahuakang [Sun, 21 Feb 2021 17:12:17 +0000 (18:12 +0100)]
Move check_for_loop_arg back to mod; split into 4 lint files

3 years agoMove MinifyingSugg into manual_memcpy
nahuakang [Sun, 21 Feb 2021 16:10:07 +0000 (17:10 +0100)]
Move MinifyingSugg into manual_memcpy

3 years agoRefactor while let loop to its own module
nahuakang [Sun, 21 Feb 2021 16:01:49 +0000 (17:01 +0100)]
Refactor while let loop to its own module

3 years agoRefactor empty loop to its own module
nahuakang [Sun, 21 Feb 2021 15:48:16 +0000 (16:48 +0100)]
Refactor empty loop to its own module

3 years agoRefactor while let on iterator lint to its module; rename for loop explicit counter...
nahuakang [Sun, 21 Feb 2021 15:37:09 +0000 (16:37 +0100)]
Refactor while let on iterator lint to its module; rename for loop explicit counter to explicit counter loop

3 years agoRefactor never loop to its own module
nahuakang [Sun, 21 Feb 2021 14:58:05 +0000 (15:58 +0100)]
Refactor never loop to its own module

3 years agoMove detect_manual_memcpy to its module; split up utils structs
nahuakang [Tue, 9 Feb 2021 22:27:03 +0000 (23:27 +0100)]
Move detect_manual_memcpy to its module; split up utils structs

3 years agoAdd detect_same_item_push to its own module
nahuakang [Tue, 9 Feb 2021 20:58:10 +0000 (21:58 +0100)]
Add detect_same_item_push to its own module

3 years agoAdd check_needless_collect to its own module
nahuakang [Tue, 9 Feb 2021 20:26:46 +0000 (21:26 +0100)]
Add check_needless_collect to its own module

3 years agoAdd check_infinite_loop to its own module
nahuakang [Tue, 9 Feb 2021 19:21:22 +0000 (20:21 +0100)]
Add check_infinite_loop to its own module

3 years agoRefactor check_for_single_element_loop to its own module
nahuakang [Mon, 8 Feb 2021 21:12:32 +0000 (22:12 +0100)]
Refactor check_for_single_element_loop to its own module

3 years agoRefactor check_for_loop_explicit_counter to its own module
nahuakang [Mon, 8 Feb 2021 21:01:05 +0000 (22:01 +0100)]
Refactor check_for_loop_explicit_counter to its own module

3 years agoRefactor check_for_loop_range into its module
nahuakang [Mon, 8 Feb 2021 20:38:00 +0000 (21:38 +0100)]
Refactor check_for_loop_range into its module

3 years agoRefactor check_for_mut_range_bound to its own module
nahuakang [Mon, 8 Feb 2021 20:20:23 +0000 (21:20 +0100)]
Refactor check_for_mut_range_bound to its own module

3 years agoRefactor check_for_loop_over_map_kv to its own module
nahuakang [Mon, 8 Feb 2021 20:04:33 +0000 (21:04 +0100)]
Refactor check_for_loop_over_map_kv to its own module

3 years agoRefactor check_for_loop_arg; rename manual_flatten's lint back to check_manual_flatten
nahuakang [Mon, 8 Feb 2021 19:47:35 +0000 (20:47 +0100)]
Refactor check_for_loop_arg; rename manual_flatten's lint back to check_manual_flatten

3 years agocreate loops dir; arrange manual_flatten lint and utils
nahuakang [Sun, 7 Feb 2021 12:35:27 +0000 (13:35 +0100)]
create loops dir; arrange manual_flatten lint and utils

3 years agoAuto merge of #6822 - camsteffen:rustfmt, r=llogiq
bors [Tue, 2 Mar 2021 08:57:11 +0000 (08:57 +0000)]
Auto merge of #6822 - camsteffen:rustfmt, r=llogiq

Rustfmt version "Two"

changelog: none

This enables some ~bug fixes~ changes from rustfmt. This is more consistent with rustc's config, and should be more forward-compatible. Also, the changes look good IMO. 😃

3 years agoUse diagnostic or language items instead of paths
Jason Newcomb [Tue, 2 Mar 2021 03:55:26 +0000 (22:55 -0500)]
Use diagnostic or language items instead of paths

3 years agoDon't move `yield` or inline assembly into closure
Jason Newcomb [Mon, 1 Mar 2021 22:25:23 +0000 (17:25 -0500)]
Don't move `yield` or inline assembly into closure

3 years agoAdd version = "Two" to rustfmt.toml
Cameron Steffen [Mon, 1 Mar 2021 17:53:33 +0000 (11:53 -0600)]
Add version = "Two" to rustfmt.toml

Ignore UI tests since this change makes rustfmt less friendly with UI
test comments.

3 years agoAuto merge of #6813 - matthiaskrgr:lintcheck_refactor, r=flip1995
bors [Mon, 1 Mar 2021 11:37:08 +0000 (11:37 +0000)]
Auto merge of #6813 - matthiaskrgr:lintcheck_refactor, r=flip1995

lintcheck, do some refactoring and add more sources

refactor: add a Config object
don't run in parallel mode by default (it didn't make sense because cargo would lock the shared target dir anyway)
show full paths (from repo root) to the source files in clippy warnings so we can just copy the path from the logfile
fix more bugs
add more crates by dtolnay and embark to the sources toml

changelog: lintcheck: refactor some code and add more sources

3 years agoupdate lintcheck_crates logs and fix typos
Matthias Krüger [Sun, 28 Feb 2021 12:59:47 +0000 (13:59 +0100)]
update lintcheck_crates logs and fix typos

3 years agolintcheck: add more embark crate sources to the sources toml
Matthias Krüger [Sun, 28 Feb 2021 12:52:26 +0000 (13:52 +0100)]
lintcheck: add more embark crate sources to the sources toml

3 years agolintcheck: make download path and source path consts, move source directory from...
Matthias Krüger [Sun, 28 Feb 2021 11:36:56 +0000 (12:36 +0100)]
lintcheck: make download path and source path consts, move source directory from traget/lintcheck/crates to target/lintcheck/sources

also update logfile with the dtolnay crates

3 years agolintcheck: more fixes
Matthias Krüger [Sun, 28 Feb 2021 01:07:01 +0000 (02:07 +0100)]
lintcheck: more fixes

fix a couple of issues when checking if lintcheck needed rerun after clippy binary changed.
I was apparently still comparing the times wrongly, but it should be fixed™ now...
I actually looked at the date of the sources.toml and not at the date of the log file!

Also fix progress report counter not advancing in squential mode

3 years agolintcheck: add a couple of dtolnays crates to the source list
Matthias Krüger [Sat, 27 Feb 2021 22:31:32 +0000 (23:31 +0100)]
lintcheck: add a couple of dtolnays crates to the source list

3 years agolintcheck: put the full paths (target/lintcheck/sources/<crate>...) to the source...
Matthias Krüger [Sat, 27 Feb 2021 11:29:13 +0000 (12:29 +0100)]
lintcheck: put the full paths (target/lintcheck/sources/<crate>...) to the source files of a warning into the lintcheck log

This is more convenient when reviewing new lint warnings that popped up in the logs

3 years agolintcheck: uses consts for clippy driver and cargo clippy paths
Matthias Krüger [Sat, 27 Feb 2021 11:05:27 +0000 (12:05 +0100)]
lintcheck: uses consts for clippy driver and cargo clippy paths

3 years agolintcheck: don't run clippy in parallel by default
Matthias Krüger [Sat, 27 Feb 2021 00:34:45 +0000 (01:34 +0100)]
lintcheck: don't run clippy in parallel by default

3 years agolintcheck: refactor: introduce a basic LintcheckConfig struct which holds the job...
Matthias Krüger [Fri, 26 Feb 2021 23:29:42 +0000 (00:29 +0100)]
lintcheck: refactor: introduce a basic LintcheckConfig struct which holds the job limit and paths to the sources and log files

3 years agoAuto merge of #6787 - matthiaskrgr:lint_msgs, r=llogiq
bors [Sun, 28 Feb 2021 20:57:48 +0000 (20:57 +0000)]
Auto merge of #6787 - matthiaskrgr:lint_msgs, r=llogiq

tests: add test that roughly ensures that our lint messages conform with the diagnostics convention of the rustc dev guide

lint message should not start with uppercase letters
lint messages should not have punctuation at the end of the last line

https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-structure

The test reads through all the .stderr files in the testsuit and checks lint messages that start with "help: ", "error: " etc.
There is also an exception list for special messages that are deemed acceptable.

changelog: make sure lint messages conform with the rustc dev guide and add test

3 years agoFix `manual_map`: do not expand macros in suggestions
Jason Newcomb [Sun, 28 Feb 2021 14:03:21 +0000 (09:03 -0500)]
Fix `manual_map`: do not expand macros in suggestions

3 years agouse different example (C-like) for valid capitalized start of lint message
Matthias Krüger [Sun, 28 Feb 2021 13:01:03 +0000 (14:01 +0100)]
use different example (C-like) for valid capitalized start of lint message

3 years agolintcheck: update logs
Matthias Krüger [Fri, 26 Feb 2021 21:02:00 +0000 (22:02 +0100)]
lintcheck: update logs

3 years agochange some lint messages and remove old entries from the ignorelist
Matthias Krüger [Fri, 26 Feb 2021 14:49:18 +0000 (15:49 +0100)]
change some lint messages and remove old entries from the ignorelist

3 years agodisable lint_message_convention test inside the rustc test suite
Matthias Krüger [Thu, 25 Feb 2021 11:30:51 +0000 (12:30 +0100)]
disable lint_message_convention test inside the rustc test suite

3 years agoupdate the lint messages and tests
Matthias Krüger [Wed, 24 Feb 2021 13:02:51 +0000 (14:02 +0100)]
update the lint messages and tests

3 years agofix clippy lint warnings
Matthias Krüger [Wed, 24 Feb 2021 12:56:04 +0000 (13:56 +0100)]
fix clippy lint warnings

3 years agotests: add test that roughly ensures that our lint messages conform with the diagnost...
Matthias Krüger [Wed, 24 Feb 2021 12:50:11 +0000 (13:50 +0100)]
tests: add test that roughly ensures that our lint messages conform with the diagnostics convention of the rustc dev guide

lint message should not start with uppercase letters
lint messages should not have punctuation at the end of the last line

https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-structure

The test reads through all the .stderr files in the testsuit and checks lint messages that start with "help: ", "error: " etc.
There is also an exception list for special messages that are deemed acceptable.

changelog: make sure lint messages conform with the rustc dev guide and add test

3 years agoAuto merge of #6802 - camsteffen:dogfood-fix, r=llogiq
bors [Sun, 28 Feb 2021 00:49:02 +0000 (00:49 +0000)]
Auto merge of #6802 - camsteffen:dogfood-fix, r=llogiq

Remove workspace and fix dogfood (again)

changelog: none

In response to https://github.com/rust-lang/rust-clippy/pull/6733#issuecomment-785792060

3 years agoAuto merge of #6812 - Y-Nak:fix-6792, r=matthiaskrgr
bors [Sat, 27 Feb 2021 14:44:02 +0000 (14:44 +0000)]
Auto merge of #6812 - Y-Nak:fix-6792, r=matthiaskrgr

Fix ICEs 6792 and 6793

fixes #6792, fixes #6793.
r? `@matthiaskrgr`

Fixes the ICEs by replacing `TyCtxt::type_of` with `TypeckResults::expr_ty`.

changelog: none

3 years agoAdd test for ICE 6793
Yoshitomo Nakanishi [Sat, 27 Feb 2021 13:46:10 +0000 (22:46 +0900)]
Add test for ICE 6793

3 years agoUse TypeckResults::expr_ty instead of TyCtxt::type_of to fix "Not a type" ICE
Yoshitomo Nakanishi [Sat, 27 Feb 2021 12:52:15 +0000 (21:52 +0900)]
Use TypeckResults::expr_ty instead of TyCtxt::type_of to fix "Not a type" ICE

3 years agoremove pub(crate)
Takayuki Maeda [Fri, 26 Feb 2021 08:38:21 +0000 (17:38 +0900)]
remove pub(crate)

3 years agoexport `derefs_to_slice` from methods module
Takayuki Maeda [Fri, 26 Feb 2021 08:07:00 +0000 (17:07 +0900)]
export `derefs_to_slice` from methods module