]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoRollup merge of #5443 - thiagoarrais:issue-2040, r=flip1995
Philipp Krones [Mon, 13 Jul 2020 13:59:41 +0000 (15:59 +0200)]
Rollup merge of #5443 - thiagoarrais:issue-2040, r=flip1995

Some accuracy lints for floating point operations

This will add some lints for accuracy on floating point operations suggested by @clarfon in #2040 (fixes #2040).

These are the remaining lints:

- [x] x.powi(2) => x * x
- [x] x.logN() / y.logN() => x.logbase(y)
- [x] x.logbase(E) => x.log()
- [x] x.logbase(10) => x.log10()
- [x] x.logbase(2) => x.log2().
- [x] x * PI / 180 => x.to_radians()
- [x] x * 180 / PI => x.to_degrees()
- [x] (x + 1).log() => x.log_1p()
- [x] sqrt(x * x + y * y) => x.hypot(y)

changelog: Included some accuracy lints for floating point operations

3 years agoAuto merge of #5769 - robojumper:match_like_matches_macro, r=phansch
bors [Fri, 10 Jul 2020 18:10:08 +0000 (18:10 +0000)]
Auto merge of #5769 - robojumper:match_like_matches_macro, r=phansch

new lint: match_like_matches_macro

Suggests using the `matches!` macro from `std` where appropriate.

`redundant_pattern_matching` has been moved into the `matches` pass to allow suppressing the suggestion where `is_some` and friends are a better replacement.

changelog: new lint: `match_like_matches_macro`

3 years agoAuto merge of #5781 - giraffate:fix_a_broken_link, r=phansch
bors [Thu, 9 Jul 2020 18:21:44 +0000 (18:21 +0000)]
Auto merge of #5781 - giraffate:fix_a_broken_link, r=phansch

Fix a broken link in CONTRIBUTING.md

changelog: none

3 years agoFix a broken link in CONTRIBUTING.md
Takayuki Nakata [Thu, 9 Jul 2020 13:07:15 +0000 (22:07 +0900)]
Fix a broken link in CONTRIBUTING.md

3 years agoAuto merge of #5771 - montrivo:bugfix/single-match-else, r=matthiaskrgr
bors [Thu, 9 Jul 2020 12:03:14 +0000 (12:03 +0000)]
Auto merge of #5771 - montrivo:bugfix/single-match-else, r=matthiaskrgr

single_match_else - single expr/stmt else block corner case

One approach to fix #3489.
See discussion in the issue.

changelog: single_match_else - single expr/stmt else block corner case fix

3 years agosingle_match_else - single expr/stmt else block corner case
Tim Nielens [Mon, 6 Jul 2020 22:35:51 +0000 (00:35 +0200)]
single_match_else - single expr/stmt else block corner case

3 years agomake match_like_matches_macro only apply to matches with a wildcard
robojumper [Wed, 8 Jul 2020 16:04:51 +0000 (18:04 +0200)]
make match_like_matches_macro only apply to matches with a wildcard

3 years agoAuto merge of #5776 - flip1995:rustup, r=flip1995
bors [Wed, 8 Jul 2020 15:56:23 +0000 (15:56 +0000)]
Auto merge of #5776 - flip1995:rustup, r=flip1995

Rustup

changelog: none

r? @ghost

3 years agoAuto merge of #74117 - Manishearth:rollup-ds7z0kx, r=Manishearth
bors [Tue, 7 Jul 2020 00:56:44 +0000 (00:56 +0000)]
Auto merge of #74117 - Manishearth:rollup-ds7z0kx, r=Manishearth

Rollup of 14 pull requests

Successful merges:

 - #70563 ([rustdoc] Page hash handling)
 - #73856 (Edit librustc_lexer top-level docs)
 - #73870 (typeck: adding type information to projection)
 - #73953 (Audit hidden/short code suggestions)
 - #73962 (libstd/net/tcp.rs: #![deny(unsafe_op_in_unsafe_fn)])
 - #73969 (mir: mark mir construction temporaries as internal)
 - #73974 (Move A|Rc::as_ptr from feature(weak_into_raw) to feature(rc_as_ptr))
 - #74067 (rustdoc: Restore underline text decoration on hover for FQN in header)
 - #74074 (Fix the return type of Windows' `OpenOptionsExt::security_qos_flags`.)
 - #74078 (Always resolve type@primitive as a primitive, not a module)
 - #74089 (Add rust-analyzer to the build manifest)
 - #74090 (Remove unused RUSTC_DEBUG_ASSERTIONS)
 - #74102 (Fix const prop ICE)
 - #74112 (Expand abbreviation in core::ffi description)

Failed merges:

r? @ghost

3 years agoRollup merge of #73870 - sexxi-goose:projection-ty, r=nikomatsakis
Manish Goregaokar [Tue, 7 Jul 2020 00:45:20 +0000 (17:45 -0700)]
Rollup merge of #73870 - sexxi-goose:projection-ty, r=nikomatsakis

typeck: adding type information to projection

This commit modifies the Place as follow:
* remove 'ty' from ProjectionKind
* add type information into to Projection
* replace 'ty' in Place with 'base_ty'
* introduce 'ty()' in `Place` to return the final type of the `Place`
* introduce `ty_before_projection()` in `Place` to return the type of
  a `Place` before i'th projection is applied

Closes https://github.com/rust-lang/project-rfc-2229/issues/5

3 years agoAuto merge of #73978 - Mark-Simulacrum:shrink-paramenv, r=nnethercote
bors [Mon, 6 Jul 2020 20:44:16 +0000 (20:44 +0000)]
Auto merge of #73978 - Mark-Simulacrum:shrink-paramenv, r=nnethercote

Shrink ParamEnv to 16 bytes

r? @nnethercote

x.py check passes but I haven't tried running perf or tests

3 years agoIncludes TODO for constants equivalent to π/180
Thiago Arrais [Mon, 6 Jul 2020 16:14:52 +0000 (13:14 -0300)]
Includes TODO for constants equivalent to π/180

3 years agoReclassify powi(2) lint under suboptimal_flops
Thiago Arrais [Mon, 22 Jun 2020 17:16:27 +0000 (14:16 -0300)]
Reclassify powi(2) lint under suboptimal_flops

3 years agoIncludes TODO comment for hypot lint
Thiago Arrais [Wed, 17 Jun 2020 16:43:11 +0000 (13:43 -0300)]
Includes TODO comment for hypot lint

3 years agoPlace radian lints under suboptimal_flops
Thiago Arrais [Mon, 15 Jun 2020 16:59:44 +0000 (13:59 -0300)]
Place radian lints under suboptimal_flops

3 years agoBetter copy for lint message
Thiago Arrais [Mon, 15 Jun 2020 16:55:12 +0000 (13:55 -0300)]
Better copy for lint message

Since x.log(y) is actually implemented as x.ln() / y.ln()

3 years agoLint for to_radians and to_degrees
Thiago Arrais [Wed, 10 Jun 2020 16:52:00 +0000 (13:52 -0300)]
Lint for to_radians and to_degrees

3 years agofix match_like_matches_macro in clippy
robojumper [Sun, 5 Jul 2020 20:11:19 +0000 (22:11 +0200)]
fix match_like_matches_macro in clippy

3 years agoLint x.log(b) / y.log(b) => x.log(y)
Thiago Arrais [Mon, 1 Jun 2020 21:32:52 +0000 (18:32 -0300)]
Lint x.log(b) / y.log(b) => x.log(y)

3 years agonew lint: match_like_matches_macro
robojumper [Sun, 5 Jul 2020 20:10:59 +0000 (22:10 +0200)]
new lint: match_like_matches_macro

3 years agoLint (x * x + y * y).sqrt() => x.hypot(y)
Thiago Arrais [Mon, 25 May 2020 16:54:39 +0000 (13:54 -0300)]
Lint (x * x + y * y).sqrt() => x.hypot(y)

3 years agoLint for x.powi(2) => x * x
Thiago Arrais [Fri, 3 Apr 2020 16:58:52 +0000 (13:58 -0300)]
Lint for x.powi(2) => x * x

3 years agoAuto merge of #5301 - JarredAllen:option_if_let_else, r=flip1995
bors [Mon, 6 Jul 2020 15:56:52 +0000 (15:56 +0000)]
Auto merge of #5301 - JarredAllen:option_if_let_else, r=flip1995

Suggest `Option::map_or`(_else) for `if let Some { y } else { x }`

Fixes #5203

There are two issues with this code that I have noticed:

- Use of `Option::map_or` causes it to always evaluate the code in the else block. If that block is computationally expensive or if it updates some state (such as getting the next value from an iterator), then this change would cause the code to behave differently. In either of those circumstances, it should suggest Option::map_or_else, which takes both cases as a closure and runs one. However, I don't know how to check if the expression would change some state, so I left the lint's applicability as MaybeIncorrect.

- There are lints which can trigger on specific sub-cases of this lint (`if_let_some_result`, `question_mark`, and `while_let_loop`) and suggest different changes (usually better ones because they're more specific). Is this acceptable for clippy to give multiple suggestions, or should I have the code check if those other lints trigger and then not trigger this lint if they do?

changelog: Add lint [`option_if_let_else`]

3 years agoShrink ParamEnv to 16 bytes
Mark Rousskov [Fri, 3 Jul 2020 00:52:40 +0000 (20:52 -0400)]
Shrink ParamEnv to 16 bytes

3 years agoFixed compile errors
JarredAllen [Sat, 4 Jul 2020 03:28:40 +0000 (20:28 -0700)]
Fixed compile errors

3 years agoFormatted updates to lints
JarredAllen [Wed, 1 Jul 2020 18:41:11 +0000 (11:41 -0700)]
Formatted updates to lints

3 years agoUpdate compile-test to follow new lint
JarredAllen [Sat, 27 Jun 2020 23:55:47 +0000 (16:55 -0700)]
Update compile-test to follow new lint

3 years agoClean existing lint code to match new lint
JarredAllen [Thu, 25 Jun 2020 18:58:47 +0000 (11:58 -0700)]
Clean existing lint code to match new lint

3 years agoFix compile error from library change
JarredAllen [Thu, 25 Jun 2020 18:39:58 +0000 (11:39 -0700)]
Fix compile error from library change

3 years agoLast few tweaks
JarredAllen [Fri, 12 Jun 2020 15:32:38 +0000 (08:32 -0700)]
Last few tweaks

3 years agoUsed clippy to clean itself
JarredAllen [Sun, 31 May 2020 22:37:21 +0000 (15:37 -0700)]
Used clippy to clean itself

3 years agoDon't lint if contains a macro
JarredAllen [Sun, 31 May 2020 22:34:10 +0000 (15:34 -0700)]
Don't lint if contains a macro

3 years agoRefactoring pt. 2
JarredAllen [Tue, 12 May 2020 00:52:47 +0000 (17:52 -0700)]
Refactoring pt. 2

3 years agoRefactoring
JarredAllen [Sun, 10 May 2020 03:44:56 +0000 (20:44 -0700)]
Refactoring

3 years agoHandle ref, mut, &, and &mut on the option
JarredAllen [Sun, 10 May 2020 03:20:57 +0000 (20:20 -0700)]
Handle ref, mut, &, and &mut on the option

3 years agoProperly parenthesize to avoid operator precedence errors
JarredAllen [Sat, 25 Apr 2020 16:08:23 +0000 (09:08 -0700)]
Properly parenthesize to avoid operator precedence errors

3 years agoStop linting on macros and correctly use braces for constructs
JarredAllen [Sat, 25 Apr 2020 15:32:33 +0000 (08:32 -0700)]
Stop linting on macros and correctly use braces for  constructs

3 years agoLint for if let Some(x) = ... instead of Option::map_or
JarredAllen [Thu, 5 Mar 2020 18:35:05 +0000 (10:35 -0800)]
Lint for if let Some(x) = ... instead of Option::map_or

3 years agoAuto merge of #4841 - phaylon:pattern-type-mismatch, r=flip1995
bors [Fri, 3 Jul 2020 16:41:26 +0000 (16:41 +0000)]
Auto merge of #4841 - phaylon:pattern-type-mismatch, r=flip1995

Added restriction lint: pattern-type-mismatch

changelog: Added a new restriction lint `pattern-type-mismatch`. This lint is especially helpful for beginners learning about the magic behind pattern matching. (This explanation might be worth to include in the next changelog.)

3 years agofmt fix
Robert Sedlacek [Fri, 3 Jul 2020 16:23:36 +0000 (18:23 +0200)]
fmt fix

3 years agoLateContext has only one lifetime parameter now
Robert Sedlacek [Fri, 3 Jul 2020 16:20:19 +0000 (18:20 +0200)]
LateContext has only one lifetime parameter now

3 years agoAuto merge of #5761 - ThibsG:TypeRepetitionThreshold, r=flip1995
bors [Fri, 3 Jul 2020 16:17:41 +0000 (16:17 +0000)]
Auto merge of #5761 - ThibsG:TypeRepetitionThreshold, r=flip1995

Improvements for `type_repetition_in_bounds` lint

Some improvements for `type_repetition_in_bounds`:
- add a configurable threshold to trigger the lint (#4380). The lint won't trigger anymore if there are more bounds (strictly) than `conf.max_trait_bounds` on this type.
- take generic args into account over bounded type (#4323)
- don't lint for predicates generated in macros (#4326)

Fixes #4380,
Fixes #4323,
Fixes #4326,
Closes #3764

changelog: Fix multiple FPs in `type_repetition_in_bounds` and add a configuration option

Note: the #3764 has already been fixed but not closed

3 years agoExpanded lint documentation
Robert Sedlacek [Wed, 1 Jul 2020 13:49:46 +0000 (15:49 +0200)]
Expanded lint documentation

3 years agoCatching up with rustc changes
Robert Sedlacek [Wed, 1 Jul 2020 13:49:06 +0000 (15:49 +0200)]
Catching up with rustc changes

3 years agoFix rebase fallout
flip1995 [Mon, 8 Jun 2020 13:10:57 +0000 (15:10 +0200)]
Fix rebase fallout

3 years agoAdjusted expected STDERR
Robert Sedlacek [Mon, 10 Feb 2020 21:19:19 +0000 (22:19 +0100)]
Adjusted expected STDERR

3 years agospan_help_and_lint -> span_lint_and_help
Robert Sedlacek [Sun, 9 Feb 2020 16:57:35 +0000 (17:57 +0100)]
span_help_and_lint -> span_lint_and_help

3 years agoAdded restriction lint: pattern-type-mismatch
Robert Sedlacek [Mon, 4 Nov 2019 18:39:03 +0000 (19:39 +0100)]
Added restriction lint: pattern-type-mismatch

3 years agoDon't lint for predicates generated in macros
ThibsG [Fri, 3 Jul 2020 09:48:28 +0000 (11:48 +0200)]
Don't lint for predicates generated in macros

3 years agoTake generic args into account for bounded type
ThibsG [Fri, 3 Jul 2020 08:29:14 +0000 (10:29 +0200)]
Take generic args into account for bounded type

3 years agoAdd configurable threshold for `type_repetition_in_bounds` lint
ThibsG [Sun, 28 Jun 2020 10:14:04 +0000 (12:14 +0200)]
Add configurable threshold for `type_repetition_in_bounds` lint

3 years agoAuto merge of #5763 - flip1995:rustup, r=Manishearth
bors [Fri, 3 Jul 2020 14:48:59 +0000 (14:48 +0000)]
Auto merge of #5763 - flip1995:rustup, r=Manishearth

Rustup

changelog: none

4 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Fri, 3 Jul 2020 10:50:41 +0000 (12:50 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

4 years agoUse 'tcx for references to AccessLevels wherever possible.
Eduard-Mihai Burtescu [Thu, 25 Jun 2020 20:41:36 +0000 (23:41 +0300)]
Use 'tcx for references to AccessLevels wherever possible.

4 years agorustc_lint: avoid using TypeckTables::empty for LateContext.
Eduard-Mihai Burtescu [Fri, 26 Jun 2020 02:55:23 +0000 (05:55 +0300)]
rustc_lint: avoid using TypeckTables::empty for LateContext.

4 years agoAuto merge of #5760 - phansch:deprecate-regex-macro, r=Manishearth
bors [Wed, 1 Jul 2020 14:50:53 +0000 (14:50 +0000)]
Auto merge of #5760 - phansch:deprecate-regex-macro, r=Manishearth

Deprecate regex_macro lint

Closes #2586

changelog: Deprecate regex_macro lint

4 years agoDeprecate regex_macro lint
Philipp Hansch [Wed, 1 Jul 2020 10:36:36 +0000 (12:36 +0200)]
Deprecate regex_macro lint

4 years agoAuto merge of #5759 - mikerite:multiple_crate_versions_20200701, r=matthiaskrgr
bors [Wed, 1 Jul 2020 08:13:52 +0000 (08:13 +0000)]
Auto merge of #5759 - mikerite:multiple_crate_versions_20200701, r=matthiaskrgr

Fix multiple_crate_versions error

Fix the versions of packages in the multiple_crate_versions ui test by
checking in the Cargo.lock for the test package. `ansi_term 0.11`
depends on `winapi ^0.3.4`. This means means that the expected stderr for
this test would have to be updated whenever `winapi 0.3` is updated
otherwise.

changelog: none

4 years agoFix multiple_crate_versions error
Michael Wright [Wed, 1 Jul 2020 05:30:03 +0000 (07:30 +0200)]
Fix multiple_crate_versions error

Fix the versions of packages in the multiple_crate_versions ui test by
checking in the Cargo.lock for the test package. `ansi_term 0.11`
depends on `winapi ^0.3.4`. This means means that the expected stderr for
this test would have to be updated whenever `winapi 0.3` is updated
otherwise.

4 years agoAuto merge of #5758 - ebroto:5704_unnested_or_pats, r=flip1995
bors [Tue, 30 Jun 2020 22:23:23 +0000 (22:23 +0000)]
Auto merge of #5758 - ebroto:5704_unnested_or_pats, r=flip1995

Require `or_patterns` to suggest nesting them

changelog: Require `#![feature(or_patterns)]` to trigger [`unnested_or_patterns`]

Fixes #5704

4 years agoRequire `or_patterns` to suggest nesting them
Eduardo Broto [Tue, 30 Jun 2020 22:15:21 +0000 (00:15 +0200)]
Require `or_patterns` to suggest nesting them

4 years agoAuto merge of #5750 - ebroto:blanket_clippy_restriction_lints, r=Manishearth,flip1995...
bors [Tue, 30 Jun 2020 21:55:46 +0000 (21:55 +0000)]
Auto merge of #5750 - ebroto:blanket_clippy_restriction_lints, r=Manishearth,flip1995,phansch,oli-obk

Lint enabling the whole restriction group

I've added it to the `correctness` category, but I may be missing some valid use cases. In that case it could be changed to `pedantic`.

changelog: Add [`blanket_clippy_restriction_lints`] to check against enabling the whole restriction group.

4 years agoMove blanket_clippy_restriction_lints to "style"
Eduardo Broto [Sat, 27 Jun 2020 19:49:34 +0000 (21:49 +0200)]
Move blanket_clippy_restriction_lints to "style"

4 years agoLint enabling the whole restriction group
Eduardo Broto [Fri, 26 Jun 2020 08:52:14 +0000 (10:52 +0200)]
Lint enabling the whole restriction group

4 years agoAuto merge of #5751 - flip1995:rustup, r=Manishearth,flip1995
bors [Tue, 30 Jun 2020 14:20:09 +0000 (14:20 +0000)]
Auto merge of #5751 - flip1995:rustup, r=Manishearth,flip1995

Rustup

cc https://github.com/rust-lang/rust/pull/73743

r? @Manishearth

changelog: none

4 years agoDisable chrono integration test
flip1995 [Tue, 30 Jun 2020 14:19:42 +0000 (16:19 +0200)]
Disable chrono integration test

4 years agoMerge remote-tracking branch 'upstream/master' into rustup2
flip1995 [Tue, 30 Jun 2020 13:40:22 +0000 (15:40 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup2

4 years agotypeck: adding type information to projection
Azhng [Wed, 24 Jun 2020 20:33:31 +0000 (16:33 -0400)]
typeck: adding type information to projection

This commit modifies the Place as follow:
* remove 'ty' from ProjectionKind
* add type information into to Projection
* replace 'ty' in Place with 'base_ty'
* introduce 'ty()' in `Place` to return the final type of the `Place`
* introduce `ty_before_projection()` in `Place` to return the type of
  a `Place` before i'th projection is applied

Closes https://github.com/rust-lang/project-rfc-2229/issues/5

4 years agoUpdate tests
Dylan MacKenzie [Fri, 26 Jun 2020 00:43:48 +0000 (17:43 -0700)]
Update tests

4 years agoAuto merge of #73756 - Manishearth:rollup-aehswb2, r=Manishearth
bors [Fri, 26 Jun 2020 10:11:43 +0000 (10:11 +0000)]
Auto merge of #73756 - Manishearth:rollup-aehswb2, r=Manishearth

Rollup of 13 pull requests

Successful merges:

 - #72620 (Omit DW_AT_linkage_name when it is the same as DW_AT_name)
 - #72967 (Don't move cursor in search box when using arrows to navigate results)
 - #73102 (proc_macro: Stop flattening groups with dummy spans)
 - #73297 (Support configurable deny-warnings for all in-tree crates.)
 - #73507 (Cleanup MinGW LLVM linkage workaround)
 - #73588 (Fix handling of reserved registers for ARM inline asm)
 - #73597 (Record span of `const` kw in GenericParamKind)
 - #73629 (Make AssocOp Copy)
 - #73681 (Update Chalk to 0.14)
 - #73707 (Fix links in `SliceIndex` documentation)
 - #73719 (emitter: column width defaults to 140)
 - #73729 (disable collectionbenches for android)
 - #73748 (Add code block to code in documentation of `List::rebase_onto`)

Failed merges:

r? @ghost

4 years agoRollup merge of #73597 - ayazhafiz:i/const-span, r=ecstatic-morse
Manish Goregaokar [Fri, 26 Jun 2020 07:39:08 +0000 (00:39 -0700)]
Rollup merge of #73597 - ayazhafiz:i/const-span, r=ecstatic-morse

Record span of `const` kw in GenericParamKind

Context: this is needed for a fix of https://github.com/rust-lang/rustfmt/issues/4263,
which currently records the span of a const generic param incorrectly
because the location of the `const` kw is not known.

I am not sure how to add tests for this; any guidance in how to do so
would be appreciated :slightly_smiling_face:

4 years agorustc_lint: only query `typeck_tables_of` when a lint needs it.
Eduard-Mihai Burtescu [Thu, 25 Jun 2020 23:56:23 +0000 (02:56 +0300)]
rustc_lint: only query `typeck_tables_of` when a lint needs it.

4 years agoAuto merge of #5748 - carols10cents:tiny-docs-fix, r=flip1995
bors [Thu, 25 Jun 2020 15:28:50 +0000 (15:28 +0000)]
Auto merge of #5748 - carols10cents:tiny-docs-fix, r=flip1995

Change a noun to a verb to make the sentence complete

changelog: Fixed some grammar in the documentation for `await_holding_lock`.

Just a tiny little thing I found while using clippy <3

4 years agoChange a noun to a verb to make the sentence complete
Carol (Nichols || Goulding) [Thu, 25 Jun 2020 15:25:21 +0000 (11:25 -0400)]
Change a noun to a verb to make the sentence complete

4 years agoAuto merge of #5701 - ebroto:4874_cmp_owned_fp, r=flip1995
bors [Wed, 24 Jun 2020 12:48:24 +0000 (12:48 +0000)]
Auto merge of #5701 - ebroto:4874_cmp_owned_fp, r=flip1995

cmp_owned: handle when PartialEq is not implemented symmetrically

changelog: Handle asymmetrical implementations of PartialEq in [`cmp_owned`].

Fixes #4874

4 years agoAuto merge of #5745 - montrivo:copy_on_clone, r=phansch
bors [Wed, 24 Jun 2020 07:11:07 +0000 (07:11 +0000)]
Auto merge of #5745 - montrivo:copy_on_clone, r=phansch

clone_on_copy - add machine applicability

Fix #4826.
Change the applicability of the lint clone_on_copy. Split a test file and run rustfix on the clone_on_copy part.

changelog: clone_on_copy - add machine applicability

4 years agocopy_on_clone - add machine applicability
Tim Nielens [Tue, 23 Jun 2020 23:01:23 +0000 (01:01 +0200)]
copy_on_clone - add machine applicability

4 years agocmp_owned: reverse operands if necessary
Eduardo Broto [Fri, 12 Jun 2020 22:03:19 +0000 (00:03 +0200)]
cmp_owned: reverse operands if necessary

4 years agocmp_owned: avoid FP when PartialEq is not implemented symmetrically
Eduardo Broto [Tue, 9 Jun 2020 20:40:43 +0000 (22:40 +0200)]
cmp_owned: avoid FP when PartialEq is not implemented symmetrically

4 years agoRecord span of `const` kw in GenericParamKind
Ayaz Hafiz [Sun, 21 Jun 2020 22:49:56 +0000 (15:49 -0700)]
Record span of `const` kw in GenericParamKind

Context: this is needed to fix https://github.com/rust-lang/rustfmt/issues/4263,
which currently records the span of a const generic param incorrectly
because the location of the `const` kw is not known.

I am not sure how to add tests for this; any guidance in how to do so
would be appreciated :slightly_smiling_face:

4 years agoAuto merge of #5694 - wangtheo:issue-5626, r=matthiaskrgr
bors [Tue, 23 Jun 2020 15:59:27 +0000 (15:59 +0000)]
Auto merge of #5694 - wangtheo:issue-5626, r=matthiaskrgr

#5626: lint iterator.map(|x| x)

changelog: adds a new lint for iterator.map(|x| x) (see https://github.com/rust-lang/rust-clippy/issues/5626)

The code also lints for result.map(|x| x) and option.map(|x| x). Also, I'm not sure if I'm checking for type adjustments correctly and I can't think of an example where .map(|x| x) would apply type adjustments.

4 years agoFix pattern match of ExprKind::MethodCall
Teddy_Wang [Tue, 23 Jun 2020 15:40:38 +0000 (11:40 -0400)]
Fix pattern match of ExprKind::MethodCall

4 years agoMerge commit 'c2c07fa9d095931eb5684a42942a7b573a0c5238' into clippyup
flip1995 [Tue, 23 Jun 2020 15:05:22 +0000 (17:05 +0200)]
Merge commit 'c2c07fa9d095931eb5684a42942a7b573a0c5238' into clippyup

4 years agoAuto merge of #5740 - lzutao:unused-unused, r=flip1995
bors [Tue, 23 Jun 2020 14:34:18 +0000 (14:34 +0000)]
Auto merge of #5740 - lzutao:unused-unused, r=flip1995

Remove unused allowed unused attributes

changelog: none

4 years agoAuto merge of #5738 - mikerite:loops-20200623-2, r=matthiaskrgr
bors [Tue, 23 Jun 2020 14:05:45 +0000 (14:05 +0000)]
Auto merge of #5738 - mikerite:loops-20200623-2, r=matthiaskrgr

Improve end of expression check in for loop lints

changelog: none

4 years agoRemove unused allowed unused attributes
Lzu Tao [Tue, 23 Jun 2020 13:59:35 +0000 (20:59 +0700)]
Remove unused allowed unused attributes

4 years agoAuto merge of #5735 - lzutao:issue-temp, r=flip1995
bors [Tue, 23 Jun 2020 13:40:02 +0000 (13:40 +0000)]
Auto merge of #5735 - lzutao:issue-temp, r=flip1995

Add more specific GitHub issue templates

changelog: Make it easier to create feature request and bug reports with issue templates.

4 years agoAuto merge of #5741 - flip1995:rollup-8chbwhy, r=flip1995
bors [Tue, 23 Jun 2020 12:52:46 +0000 (12:52 +0000)]
Auto merge of #5741 - flip1995:rollup-8chbwhy, r=flip1995

Rollup of 9 pull requests

Successful merges:

 - #5178 (clippy-driver: pass all args to rustc if --rustc is present)
 - #5705 (Downgrade unnested_or_patterns to pedantic)
 - #5709 (Fix ICE in consts::binop)
 - #5710 (typo)
 - #5712 (Remove `bar` from blacklisted names)
 - #5713 (Use lints in Clippy that are enabled in rustc bootstrap)
 - #5716 (Fix typo in wildcard_imports)
 - #5724 (redundant_pattern_matching: avoid non-`const fn` calls in const contexts)
 - #5726 (Fix typo)

Failed merges:

r? @ghost

changelog: rollup

4 years agoRollup merge of #5726 - sozysozbot:patch-1, r=flip1995
Philipp Krones [Tue, 23 Jun 2020 12:39:50 +0000 (14:39 +0200)]
Rollup merge of #5726 - sozysozbot:patch-1, r=flip1995

Fix typo

changelog: extending it's lifetime -> extending its lifetime

4 years agoRollup merge of #5724 - ebroto:5697_const_result_option, r=Manishearth
Philipp Krones [Tue, 23 Jun 2020 12:39:49 +0000 (14:39 +0200)]
Rollup merge of #5724 - ebroto:5697_const_result_option, r=Manishearth

redundant_pattern_matching: avoid non-`const fn` calls in const contexts

changelog: Avoid suggesting non-`const fn` calls in const contexts in [`redundant_pattern_matching`]

Fixes #5697

4 years agoRollup merge of #5716 - bugadani:patch-1, r=matthiaskrgr
Philipp Krones [Tue, 23 Jun 2020 12:39:48 +0000 (14:39 +0200)]
Rollup merge of #5716 - bugadani:patch-1, r=matthiaskrgr

Fix typo in wildcard_imports

changelog: none

4 years agoRollup merge of #5713 - flip1995:more_lints, r=Manishearth
Philipp Krones [Tue, 23 Jun 2020 12:39:47 +0000 (14:39 +0200)]
Rollup merge of #5713 - flip1995:more_lints, r=Manishearth

Use lints in Clippy that are enabled in rustc bootstrap

cc https://github.com/rust-lang/rust/pull/73297#discussion_r439747061

changelog: none

4 years agoRollup merge of #5712 - ijijn:master, r=flip1995
Philipp Krones [Tue, 23 Jun 2020 12:39:45 +0000 (14:39 +0200)]
Rollup merge of #5712 - ijijn:master, r=flip1995

Remove `bar` from blacklisted names

changelog: Remove `bar` from blacklisted names
fixes #5225

4 years agoRollup merge of #5710 - lcnr:patch-1, r=flip1995
Philipp Krones [Tue, 23 Jun 2020 12:39:44 +0000 (14:39 +0200)]
Rollup merge of #5710 - lcnr:patch-1, r=flip1995

typo

changelog: none

4 years agoRollup merge of #5709 - ebroto:5389_ice, r=Manishearth
Philipp Krones [Tue, 23 Jun 2020 12:39:43 +0000 (14:39 +0200)]
Rollup merge of #5709 - ebroto:5389_ice, r=Manishearth

Fix ICE in consts::binop

changelog: Fix ICE in `consts::binop`

Fixes #5389

4 years agoRollup merge of #5705 - dtolnay:orpat, r=flip1995
Philipp Krones [Tue, 23 Jun 2020 12:39:42 +0000 (14:39 +0200)]
Rollup merge of #5705 - dtolnay:orpat, r=flip1995

Downgrade unnested_or_patterns to pedantic

Even with #5704 fixed, I don't believe it is a safe bet that if someone is using or-patterns anywhere in a codebase then they want to use it as much as possible in the whole codebase. I think it would be reasonable to reevaluate after the feature is stable. I feel that a warn-by-default lint suggesting use of an unstable feature, even if already being used in one place, is questionable.

changelog: Remove unnested_or_patterns from default set of enabled lints

4 years agoRollup merge of #5178 - matthiaskrgr:rustc_arg_pass, r=flip1995
Philipp Krones [Tue, 23 Jun 2020 12:39:40 +0000 (14:39 +0200)]
Rollup merge of #5178 - matthiaskrgr:rustc_arg_pass, r=flip1995

clippy-driver: pass all args to rustc if --rustc is present

changelog: clippy-driver: pass all args to rustc if --rustc is present

4 years agoFix fallout
flip1995 [Sat, 13 Jun 2020 16:22:49 +0000 (18:22 +0200)]
Fix fallout

4 years agoUse lints in Clippy that are enabled in rustc bootstrap
flip1995 [Sat, 13 Jun 2020 16:22:38 +0000 (18:22 +0200)]
Use lints in Clippy that are enabled in rustc bootstrap

4 years agoAuto merge of #5739 - flip1995:rustup, r=flip1995
bors [Tue, 23 Jun 2020 12:04:08 +0000 (12:04 +0000)]
Auto merge of #5739 - flip1995:rustup, r=flip1995

Rustup

changelog: none

r? @ghost