]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAllow allowing of toplevel_ref_arg lint
Philipp Hansch [Fri, 19 Apr 2019 13:18:32 +0000 (15:18 +0200)]
Allow allowing of toplevel_ref_arg lint

I'm not sure why some lints need the `HirId` to be able to recognize the
lint level attributes, but this commit makes the lint level attributes
work for `toplevel_ref_arg`.

5 years agoAuto merge of #3990 - felixrabe:patch-1, r=flip1995
bors [Thu, 18 Apr 2019 23:16:15 +0000 (23:16 +0000)]
Auto merge of #3990 - felixrabe:patch-1, r=flip1995

Typo

changelog: none

5 years agoAuto merge of #3978 - phansch:rustfix_len_zero, r=flip1995
bors [Thu, 18 Apr 2019 21:18:23 +0000 (21:18 +0000)]
Auto merge of #3978 - phansch:rustfix_len_zero, r=flip1995

Add run-rustfix for len_zero lint

* Extracts len_without_is_empty into separate file
* Adds `// run-rustfix` to `tests/ui/len_zero.rs`

cc #3630

5 years agoTypo
Felix Rabe [Thu, 18 Apr 2019 13:08:14 +0000 (15:08 +0200)]
Typo

5 years agoAuto merge of #3954 - andrehjr:add-lint-path-buf-overwrite, r=flip1995
bors [Thu, 18 Apr 2019 11:29:43 +0000 (11:29 +0000)]
Auto merge of #3954 - andrehjr:add-lint-path-buf-overwrite, r=flip1995

Add Lint PathBufPushOverwrite

Closes #3923

This is a very simple Lint that checks if push is being called with a Root Path. Because that can make it overwrite the previous path.

I used std::path::Path to check if it's root, in order to keep it working across windows/linux environments instead of checking for '/'. Is that alright?

On the `if_chain!` block, Is there a way to make it short while getting the value of the first argument? I got the example from other lints.

Note that this is first Lint, I hope I got everything covered  ðŸš€

5 years agoAdd lint PathBufPushOverwrite
André Luis Leal Cardoso Junior [Sat, 13 Apr 2019 16:47:46 +0000 (13:47 -0300)]
Add lint PathBufPushOverwrite

5 years agoAuto merge of #3985 - phansch:move_some_cast_tests, r=flip1995
bors [Thu, 18 Apr 2019 10:06:55 +0000 (10:06 +0000)]
Auto merge of #3985 - phansch:move_some_cast_tests, r=flip1995

Move two cast_lossless tests to their correct files

First part of checking off the `tests/ui/cast.rs` checkbox in #3630.

5 years agoAuto merge of #3987 - phansch:rustfix_option_map_or_none, r=flip1995
bors [Thu, 18 Apr 2019 09:43:42 +0000 (09:43 +0000)]
Auto merge of #3987 - phansch:rustfix_option_map_or_none, r=flip1995

Add run-rustfix for option_map_or_none lint

* Extracts `option_map_or_none` tests into separate file
 * Adds `// run-rustfix` to `tests/ui/option_map_or_none.rs`

cc #3630

5 years agoAuto merge of #3984 - phansch:bytecount_sugg, r=flip1995
bors [Thu, 18 Apr 2019 07:49:09 +0000 (07:49 +0000)]
Auto merge of #3984 - phansch:bytecount_sugg, r=flip1995

Change naive_bytecount applicability to MaybeIncorrect

We can't use `MachineApplicable` here as applying the fix will cause
another error because `bytecount` would first have to be added to the
Cargo.toml.

Example:

```
error: You appear to be counting bytes the naive way
  --> $DIR/bytecount.rs:5:13
   |
LL |     let _ = x.iter().filter(|&&a| a == 0).count(); // naive byte count
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider using the bytecount crate: `bytecount::count(x, 0)`
```

Just replacing it with the suggestion is not enough.

cc #3630

5 years agoAuto merge of #3968 - kraai:lint-pass-macros, r=flip1995
bors [Thu, 18 Apr 2019 07:24:35 +0000 (07:24 +0000)]
Auto merge of #3968 - kraai:lint-pass-macros, r=flip1995

Lint pass macros

5 years agoAdd run-rustfix for option_map_or_none lint
Philipp Hansch [Thu, 18 Apr 2019 06:12:59 +0000 (08:12 +0200)]
Add run-rustfix for option_map_or_none lint

5 years agoMove two cast_lossless tests to their correct files
Philipp Hansch [Wed, 17 Apr 2019 19:03:22 +0000 (21:03 +0200)]
Move two cast_lossless tests to their correct files

First part of checking off the `tests/ui/cast.rs` checkbox in #3630.

5 years agoChange naive_bytecount applicability MaybeIncorrect
Philipp Hansch [Wed, 17 Apr 2019 18:46:42 +0000 (20:46 +0200)]
Change naive_bytecount applicability MaybeIncorrect

We can't use `MachineApplicable` here as applying the fix will cause
another error because `bytecount` would first have to be added to the
Cargo.toml.

5 years agoAdd tests for declare_lint_pass and impl_lint_pass
Matthew Kraai [Tue, 16 Apr 2019 22:21:12 +0000 (15:21 -0700)]
Add tests for declare_lint_pass and impl_lint_pass

5 years agoUse lint pass macros
Matthew Kraai [Mon, 8 Apr 2019 20:43:55 +0000 (13:43 -0700)]
Use lint pass macros

Fixes #3917.

5 years agoDocument `declare_lint_pass!`
Matthew Kraai [Mon, 8 Apr 2019 06:40:59 +0000 (23:40 -0700)]
Document `declare_lint_pass!`

5 years agoFix lint_without_lint_pass internal lint
flip1995 [Fri, 5 Apr 2019 20:21:19 +0000 (22:21 +0200)]
Fix lint_without_lint_pass internal lint

5 years agoAuto merge of #3926 - flip1995:def_path_uplift, r=phansch
bors [Wed, 17 Apr 2019 11:09:25 +0000 (11:09 +0000)]
Auto merge of #3926 - flip1995:def_path_uplift, r=phansch

Use {get,match}_def_path from rustc

This is a follow up of the uplift of `{get,match}_def_path` to rustc.

~~This is blocked on rust-lang/rust#59779~~

5 years agoUse {get,match}_def_path from LateContext
flip1995 [Sun, 7 Apr 2019 17:44:10 +0000 (19:44 +0200)]
Use {get,match}_def_path from LateContext

5 years agoRemove uplifted functions {get,match}_def_path from Clippy
flip1995 [Sun, 7 Apr 2019 17:40:46 +0000 (19:40 +0200)]
Remove uplifted functions {get,match}_def_path from Clippy

5 years agoAuto merge of #3966 - flip1995:internal_lints, r=oli-obk
bors [Wed, 17 Apr 2019 04:46:19 +0000 (04:46 +0000)]
Auto merge of #3966 - flip1995:internal_lints, r=oli-obk

Enable rustc internal lints

Closes #3965

I'm not 100% sure if enabling the `-Zunstable-options` flag in the `.cargo/config` file is the right place.

5 years agoAuto merge of #3977 - phansch:add_rustfix_bool_comparison, r=flip1995
bors [Wed, 17 Apr 2019 02:35:02 +0000 (02:35 +0000)]
Auto merge of #3977 - phansch:add_rustfix_bool_comparison, r=flip1995

Add run-rustfix for bool_comparison lint

cc #3630

5 years agoAuto merge of #3976 - phansch:deref_addrof_rustfix, r=flip1995
bors [Wed, 17 Apr 2019 01:50:58 +0000 (01:50 +0000)]
Auto merge of #3976 - phansch:deref_addrof_rustfix, r=flip1995

Add run-rustfix for deref_addrof lint

* renames `tests/ui/reference.{rs,stderr}` to
  `tests/ui/deref_addrof.{rs,stderr}
* Moves small part of the testfile to a separate file as the lint
  triggered again on the fixed code (as intended)
* Adds `// run-rustfix` to `tests/ui/deref_addrof.rs`

cc #3630

5 years agoAuto merge of #3975 - phansch:has_placeholders, r=flip1995
bors [Wed, 17 Apr 2019 01:14:27 +0000 (01:14 +0000)]
Auto merge of #3975 - phansch:has_placeholders, r=flip1995

Change while_let_loop applicability to HasPlaceholders

The suggestion has been changed at some point to use `..` in the suggested code.
Due to that we can't make the lint MachineApplicable anymore.

cc #3630

5 years agoAuto merge of #3972 - rust-lang:oli-obk-patch-1, r=flip1995,Manishearth
bors [Tue, 16 Apr 2019 23:52:59 +0000 (23:52 +0000)]
Auto merge of #3972 - rust-lang:oli-obk-patch-1, r=flip1995,Manishearth

Create PULL_REQUEST_TEMPLATE

changelog: none

addresses https://github.com/rust-lang/rust-clippy/issues/3955#issuecomment-483567400

5 years agoAdd run-rustfix for len_zero lint
Philipp Hansch [Tue, 16 Apr 2019 19:46:07 +0000 (21:46 +0200)]
Add run-rustfix for len_zero lint

* Extracts len_without_is_empty into separate file
* Adds `// run-rustfix` to `tests/ui/len_zero.rs`

5 years agoAdd run-rustfix for bool_comparison lint
Philipp Hansch [Tue, 16 Apr 2019 18:42:54 +0000 (20:42 +0200)]
Add run-rustfix for bool_comparison lint

5 years agoAdd run-rustfix for deref_addrof lint
Philipp Hansch [Tue, 16 Apr 2019 18:26:55 +0000 (20:26 +0200)]
Add run-rustfix for deref_addrof lint

* renames `tests/ui/reference.{rs,stderr}` to
  `tests/ui/deref_addrof.{rs,stderr}
* Moves small part of the testfile to a separate file as the lint
  triggered again on the fixed code (as intended)
* Adds `// run-rustfix` to `tests/ui/deref_addrof.rs`

5 years agowhile_let_loop uses placeholders in suggestions
Philipp Hansch [Tue, 16 Apr 2019 18:05:16 +0000 (20:05 +0200)]
while_let_loop uses placeholders in suggestions

Due to that we can't make the lint MachineApplicable anymore.

5 years agoRemove rust-toolchain file from clippy_dev
flip1995 [Tue, 16 Apr 2019 15:17:07 +0000 (17:17 +0200)]
Remove rust-toolchain file from clippy_dev

5 years agoUpdate adding_lints.md
Oliver Scherer [Tue, 16 Apr 2019 13:16:08 +0000 (15:16 +0200)]
Update adding_lints.md

5 years agoUpdate PULL_REQUEST_TEMPLATE
Oliver Scherer [Tue, 16 Apr 2019 13:15:19 +0000 (15:15 +0200)]
Update PULL_REQUEST_TEMPLATE

5 years agoAdd new lint checklist
Oliver Scherer [Tue, 16 Apr 2019 11:30:46 +0000 (13:30 +0200)]
Add new lint checklist

5 years agoCreate PULL_REQUEST_TEMPLATE
Oliver Scherer [Tue, 16 Apr 2019 09:04:42 +0000 (11:04 +0200)]
Create PULL_REQUEST_TEMPLATE

5 years agoAuto merge of #3970 - rust-lang:map_copied, r=flip1995
bors [Tue, 16 Apr 2019 07:29:35 +0000 (07:29 +0000)]
Auto merge of #3970 - rust-lang:map_copied, r=flip1995

Suggest .copied() instead of .cloned() in map_clone where applicable

partial fix for https://github.com/rust-lang/rust-clippy/issues/3958

changelog: Improve suggestion in `map_clone` to suggest `.copied()` where applicable

5 years agoOnly suggest .copied() for Option right now
Manish Goregaokar [Mon, 15 Apr 2019 21:48:45 +0000 (14:48 -0700)]
Only suggest .copied() for Option right now

5 years agoAlso suggest .copied() when .clone() is called on a Copy type
Manish Goregaokar [Mon, 15 Apr 2019 21:39:41 +0000 (14:39 -0700)]
Also suggest .copied() when .clone() is called on a Copy type

5 years agoSuggest .copied() instead of .cloned() in map_clone when dealing with references
Manish Goregaokar [Mon, 15 Apr 2019 21:32:39 +0000 (14:32 -0700)]
Suggest .copied() instead of .cloned() in map_clone when dealing with references

5 years agoDeny rustc internal lints
flip1995 [Mon, 15 Apr 2019 11:05:25 +0000 (13:05 +0200)]
Deny rustc internal lints

5 years agoRemove clippy::default_hash_types internal lint
flip1995 [Mon, 15 Apr 2019 11:04:32 +0000 (13:04 +0200)]
Remove clippy::default_hash_types internal lint

5 years agoEnable -Zunstable-options in .cargo/config
flip1995 [Mon, 15 Apr 2019 11:03:07 +0000 (13:03 +0200)]
Enable -Zunstable-options in .cargo/config

5 years agoAuto merge of #3961 - rust-lang:rustup, r=matthiaskrgr
bors [Sun, 14 Apr 2019 21:08:00 +0000 (21:08 +0000)]
Auto merge of #3961 - rust-lang:rustup, r=matthiaskrgr

Rust upgrade to rustc 1.35.0-nightly (9cd61f025 2019-04-14)

Handles breakages from https://github.com/rust-lang/rust/pull/59877

r? @oli-obk @matthiaskrgr

5 years agoClean up unused cx parameters
Manish Goregaokar [Sun, 14 Apr 2019 20:19:33 +0000 (13:19 -0700)]
Clean up unused cx parameters

5 years agoHirIdify ReadVisitor
Manish Goregaokar [Sun, 14 Apr 2019 20:18:34 +0000 (13:18 -0700)]
HirIdify ReadVisitor

5 years agoUse _from_hir_id APIs
Manish Goregaokar [Sun, 14 Apr 2019 20:14:17 +0000 (13:14 -0700)]
Use _from_hir_id APIs

5 years agoRemove now-unnecessary calls to node_to_hir_id
Manish Goregaokar [Sun, 14 Apr 2019 20:09:17 +0000 (13:09 -0700)]
Remove now-unnecessary calls to node_to_hir_id

5 years agoAuto merge of #3960 - phansch:fix_except, r=flip1995
bors [Sun, 14 Apr 2019 15:56:58 +0000 (15:56 +0000)]
Auto merge of #3960 - phansch:fix_except, r=flip1995

Remove `except` in suspicious_else_formatting

96c34e85 contains the fix:

This was causing two different ICEs in #3741. The first was fixed in #3925.

The second one is fixed with this commit: We just don't `expect` anymore.
If the snippet doesn't contain an `else`, we stop emitting the lint because
it's not a suspiciously formatted else anyway.

Unfortunately I wasn't able to provide a minimal test case, but I think it's
fine since it's just ignoring the `None` case now.

And ad27e3ff cleans up the lint code to use `if_chain`.

Fixes #3741 once more.

5 years agoAuto merge of #3956 - rust-lang:beta-clog, r=phansch
bors [Sun, 14 Apr 2019 15:17:40 +0000 (15:17 +0000)]
Auto merge of #3956 - rust-lang:beta-clog, r=phansch

Beta changelog

Maintain a changelog for beta so the release team can easily include important additions in the release blog posts.

r? @phansch, @oli-obk

5 years agoLink to ICEs
Manish Goregaokar [Sun, 14 Apr 2019 15:17:01 +0000 (08:17 -0700)]
Link to ICEs

5 years agoUpdate CHANGELOG.md
Philipp Hansch [Sun, 14 Apr 2019 15:14:48 +0000 (08:14 -0700)]
Update CHANGELOG.md

Co-Authored-By: Manishearth <manishsmail@gmail.com>
5 years agocargo fmt
Philipp Hansch [Sun, 14 Apr 2019 11:37:38 +0000 (13:37 +0200)]
cargo fmt

5 years agoAuto merge of #3951 - phansch:add_combine_integration_test, r=phansch
bors [Sun, 14 Apr 2019 09:46:47 +0000 (09:46 +0000)]
Auto merge of #3951 - phansch:add_combine_integration_test, r=phansch

Add Marwes/combine to integration tests

link: https://github.com/Marwes/combine
`combine` uses a lot of macros internally, has been downloaded more than 200_000
times and is also a dependency of [`redis-rs`](https://crates.io/crates/redis).

Clippy also previously ICEd on combine in #3747 so I think it would be
good to have this crate as an integration test.

5 years agoRefactor suspicious_else_formatting using if_chain
Philipp Hansch [Sun, 14 Apr 2019 09:12:51 +0000 (11:12 +0200)]
Refactor suspicious_else_formatting using if_chain

5 years agoRemove `except` in suspicious_else_formatting
Philipp Hansch [Sun, 14 Apr 2019 09:04:41 +0000 (11:04 +0200)]
Remove `except` in suspicious_else_formatting

This was causing two different ICEs in #3741.
The first was fixed in #3925.

The second one is fixed with this commit: We just don't `expect`
anymore. If the snippet doesn't contain an `else`, we stop emitting the
lint because it's not a suspiciously formatted else anyway.

5 years agoAuto merge of #3959 - rust-lang:rustup, r=phansch
bors [Sun, 14 Apr 2019 09:00:33 +0000 (09:00 +0000)]
Auto merge of #3959 - rust-lang:rustup, r=phansch

Rust upgrade to rustc 1.35.0-nightly (00856722b 2019-04-13)

r? @phansch @oli-obk

5 years agoRust upgrade to rustc 1.35.0-nightly (00856722b 2019-04-13)
Manish Goregaokar [Sun, 14 Apr 2019 01:57:16 +0000 (18:57 -0700)]
Rust upgrade to rustc 1.35.0-nightly (00856722b 2019-04-13)

5 years agoBeta changelog
Manish Goregaokar [Sat, 13 Apr 2019 22:05:25 +0000 (15:05 -0700)]
Beta changelog

5 years agoAuto merge of #3950 - phansch:update_changelog, r=Manishearth
bors [Sat, 13 Apr 2019 17:52:25 +0000 (17:52 +0000)]
Auto merge of #3950 - phansch:update_changelog, r=Manishearth

Update changelog for Rust 1.34.0

[Rendered](https://github.com/phansch/rust-clippy/blob/update_changelog/CHANGELOG.md#rust-134-2019-04-10)

5 years agoAdd Marwes/combine to integration tests
Philipp Hansch [Sat, 13 Apr 2019 11:21:14 +0000 (13:21 +0200)]
Add Marwes/combine to integration tests

link: https://github.com/Marwes/combine
`combine` uses a lot of macros internally, has been downloaded more than 200_000
times and is also a dependency of [`redis-rs`](https://crates.io/crates/redis).

Clippy also previously ICEd on combine in #3747 so I think it would be
good to have this crate as an integration test.

5 years agoMention configuration option for too_many_lines lint
Philipp Hansch [Sat, 13 Apr 2019 09:04:58 +0000 (11:04 +0200)]
Mention configuration option for too_many_lines lint

5 years agoUpdate changelog for Rust 1.34.0
Philipp Hansch [Sat, 13 Apr 2019 07:53:57 +0000 (09:53 +0200)]
Update changelog for Rust 1.34.0

5 years agoAuto merge of #3946 - rchaser53:issue-3920, r=flip1995
bors [Fri, 12 Apr 2019 17:03:01 +0000 (17:03 +0000)]
Auto merge of #3946 - rchaser53:issue-3920, r=flip1995

fix format does not parse escaped braces error

related: https://github.com/rust-lang/rust-clippy/issues/3920

5 years agofix format does not parse escaped braces error
rchaser53 [Tue, 9 Apr 2019 14:15:48 +0000 (23:15 +0900)]
fix format does not parse escaped braces  error

5 years agoAuto merge of #3945 - flip1995:rustup, r=phansch
bors [Fri, 12 Apr 2019 11:53:08 +0000 (11:53 +0000)]
Auto merge of #3945 - flip1995:rustup, r=phansch

Rustup

cc https://github.com/rust-lang/rust/pull/59227#issuecomment-482411861

This fix is obsolet once rust-lang/rust#59779 and #3926 is merged.

5 years agoFix `get_def_path`
flip1995 [Fri, 12 Apr 2019 08:58:25 +0000 (10:58 +0200)]
Fix `get_def_path`

This fix is obsolet once rust-lang/rust#59779 and #3926 is merged.

5 years agoAuto merge of #3938 - phansch:more_uicleanup, r=oli-obk
bors [Thu, 11 Apr 2019 07:04:44 +0000 (07:04 +0000)]
Auto merge of #3938 - phansch:more_uicleanup, r=oli-obk

UI test cleanup: Extract or_fun_call and iter_nth tests

cc #2038

5 years agoUI test cleanup: Extract iter_nth tests
Philipp Hansch [Thu, 11 Apr 2019 05:58:50 +0000 (07:58 +0200)]
UI test cleanup: Extract iter_nth tests

5 years agoUI test cleanup: Extract or_fun_call tests
Philipp Hansch [Thu, 11 Apr 2019 05:47:04 +0000 (07:47 +0200)]
UI test cleanup: Extract or_fun_call tests

5 years agoAuto merge of #3930 - sunjay:patch-1, r=flip1995
bors [Thu, 11 Apr 2019 05:09:18 +0000 (05:09 +0000)]
Auto merge of #3930 - sunjay:patch-1, r=flip1995

Mention that -D warnings will deny ALL warnings, not just clippy warnings

If we pass `-D warnings` to clippy, it causes the build to fail if there are *any* warnings, even the ones not generated by clippy. This isn't immediately obvious when you're looking at this as someone just setting up clippy, so people might not expect this nor know how to fix it. I've added a few sentences in the README to help anyone who runs into this.

These docs are useful for anyone setting up clippy warnings to be denied during CI, but still otherwise want rustc warnings to be allowed.

I could have also changed `-D warnings` to `-D clippy::all` in the Travis configurations themselves, but I wasn't sure what you would prefer to have people use as the default.

5 years agoUpdate README.md
Philipp Krones [Thu, 11 Apr 2019 02:17:17 +0000 (22:17 -0400)]
Update README.md

Co-Authored-By: sunjay <sunjay@users.noreply.github.com>
5 years agoAuto merge of #3931 - phansch:3891, r=flip1995
bors [Wed, 10 Apr 2019 20:57:15 +0000 (20:57 +0000)]
Auto merge of #3931 - phansch:3891, r=flip1995

Fix ICE in decimal_literal_representation lint

Handling the integer parsing properly instead of just unwrapping.

Note that the test is not catching the ICE because plain UI tests
[currently hide ICEs][compiletest_issue]. Once that issue is fixed, this
test would fail properly again.

Fixes #3891

[compiletest_issue]: https://github.com/laumann/compiletest-rs/issues/169

5 years agoRefactor check_lit method
Philipp Hansch [Wed, 10 Apr 2019 19:05:56 +0000 (21:05 +0200)]
Refactor check_lit method

5 years agoAuto merge of #3937 - stepnivlk:type_dependent_defs-wrappers, r=oli-obk
bors [Wed, 10 Apr 2019 14:54:54 +0000 (14:54 +0000)]
Auto merge of #3937 - stepnivlk:type_dependent_defs-wrappers, r=oli-obk

Support updated type dependent def ID getter

This PR changes all the calls to `type_dependent_defs` (with panics via `[]`) to new method `type_dependent_def_id` with more explicit `unwrap` panic.

Rust PR: https://github.com/rust-lang/rust/pull/59216
Issue author: @oli-obk

5 years agoSupport updated type dependent def ID getter
Tomas Koutsky [Wed, 10 Apr 2019 14:18:02 +0000 (16:18 +0200)]
Support updated type dependent def ID getter

5 years agoAuto merge of #3933 - phansch:add_rustfix_eta, r=oli-obk
bors [Wed, 10 Apr 2019 09:15:27 +0000 (09:15 +0000)]
Auto merge of #3933 - phansch:add_rustfix_eta, r=oli-obk

Add // run-rustfix for eta.rs test

cc #3071, #3630

5 years agoAuto merge of #3932 - phansch:2910, r=flip1995
bors [Wed, 10 Apr 2019 07:29:15 +0000 (07:29 +0000)]
Auto merge of #3932 - phansch:2910, r=flip1995

Don't emit useless_attribute lint in external macros

Fixes #2910

5 years agoAdd // run-rustfix for eta.rs test
Philipp Hansch [Wed, 10 Apr 2019 06:16:07 +0000 (08:16 +0200)]
Add // run-rustfix for eta.rs test

cc #3071, #3630

5 years agoCode formatting/cleanup
Philipp Hansch [Wed, 10 Apr 2019 05:50:34 +0000 (07:50 +0200)]
Code formatting/cleanup

5 years agoDon't emit useless_attribute lint in external macros
Philipp Hansch [Tue, 9 Apr 2019 21:19:11 +0000 (23:19 +0200)]
Don't emit useless_attribute lint in external macros

5 years agoExclude ice-3891.rs from rustfmt run
Philipp Hansch [Tue, 9 Apr 2019 18:53:38 +0000 (20:53 +0200)]
Exclude ice-3891.rs from rustfmt run

Because the code triggers a rustc parse error which makes rustfmt fail.

5 years agoAuto merge of #3925 - phansch:3741, r=flip1995
bors [Tue, 9 Apr 2019 07:13:08 +0000 (07:13 +0000)]
Auto merge of #3925 - phansch:3741, r=flip1995

Fix ICE in suspicious_else_formatting

Fixes #3741

5 years agoFix ICE in decimal_literal_representation lint
Philipp Hansch [Mon, 8 Apr 2019 20:06:02 +0000 (22:06 +0200)]
Fix ICE in decimal_literal_representation lint

Handling the integer parsing properly instead of just unwrapping.

Note that the test is not catching the ICE because plain UI tests
[currently hide ICEs][compiletest_issue]. Once that issue is fixed, this
test would fail properly again.

[compiletest_issue]: https://github.com/laumann/compiletest-rs/issues/169

5 years agoRemove force-host and explain no-prefer-dynamic
Philipp Hansch [Mon, 8 Apr 2019 19:23:39 +0000 (21:23 +0200)]
Remove force-host and explain no-prefer-dynamic

5 years agoMention that -D warnings will deny ALL warnings, not just clippy warnings
Sunjay Varma [Mon, 8 Apr 2019 17:51:54 +0000 (13:51 -0400)]
Mention that -D warnings will deny ALL warnings, not just clippy warnings

5 years agoAuto merge of #3929 - KarboniteKream:single-char-pattern, r=oli-obk
bors [Mon, 8 Apr 2019 14:01:20 +0000 (14:01 +0000)]
Auto merge of #3929 - KarboniteKream:single-char-pattern, r=oli-obk

Escape a single quote in single_char_pattern hint

This PR correctly escapes single quotes in the hint for `single_char_pattern`.
For instance, the hint for `x.split("'")` was `'''`, while it should be `'\''`.

5 years agoEscape a single quote in single_char_pattern hint
Klemen Košir [Mon, 8 Apr 2019 12:55:50 +0000 (21:55 +0900)]
Escape a single quote in single_char_pattern hint

5 years agoAuto merge of #3921 - euclio:single-char-names-multispan, r=flip1995
bors [Mon, 8 Apr 2019 08:42:13 +0000 (08:42 +0000)]
Auto merge of #3921 - euclio:single-char-names-multispan, r=flip1995

use a multispan for MANY_SINGLE_CHAR_NAMES

5 years agoAuto merge of #3848 - felix91gr:null_transmute, r=flip1995
bors [Mon, 8 Apr 2019 07:20:25 +0000 (07:20 +0000)]
Auto merge of #3848 - felix91gr:null_transmute, r=flip1995

Transmuting known null ptr to ref

Working on implementing #628

5 years agoAuto merge of #3901 - rail-rain:issue_1670, r=flip1995
bors [Mon, 8 Apr 2019 06:28:15 +0000 (06:28 +0000)]
Auto merge of #3901 - rail-rain:issue_1670, r=flip1995

Fix `explicit_counter_loop` suggestion

#1670

This code seems to me to work, but I have two question.
* Because range expression desugared in hir, `Sugg::hir` doesn't add parenthesis to range expression.  Which function is better to check range do you think, `check_for_loop_explicit_counter` or `hir_from_snippet`?
* Do you think we need to distinguish between range expression and struct expression that creates `std::ops::Range*`?

5 years agoAuto merge of #3885 - mikerite:clippy_dev_toolchain, r=phansch
bors [Mon, 8 Apr 2019 05:58:34 +0000 (05:58 +0000)]
Auto merge of #3885 - mikerite:clippy_dev_toolchain, r=phansch

Add rust-toolchain for clippy_dev

AFAIK, `clippy_dev` is supposed to be built on stable. (This is why it's not a `[bin]` inside the root `Cargo.toml`.) This adds a `rust-toolchain` file for easy switching.

5 years agocargo fmt
Philipp Hansch [Mon, 8 Apr 2019 05:56:54 +0000 (07:56 +0200)]
cargo fmt

5 years agoAuto merge of #3928 - rust-lang:tmpadd, r=Manishearth
bors [Sun, 7 Apr 2019 21:36:51 +0000 (21:36 +0000)]
Auto merge of #3928 - rust-lang:tmpadd, r=Manishearth

Re-add tmp feature to compiletest

Got accidentally removed in the rustup

5 years agoRe-add tmp feature to compiletest
Manish Goregaokar [Sun, 7 Apr 2019 21:35:57 +0000 (14:35 -0700)]
Re-add tmp feature to compiletest

Got accidentally removed in the rustup

5 years agoAuto merge of #3927 - rust-lang:rustup, r=Manishearth
bors [Sun, 7 Apr 2019 20:41:39 +0000 (20:41 +0000)]
Auto merge of #3927 - rust-lang:rustup, r=Manishearth

Revert compiletest hacks, use latest compiletest

The libtest changes have been reverted, see https://github.com/rust-lang/rust/pull/59766,  https://github.com/laumann/compiletest-rs/pull/174

5 years agoRemove libtest from deps
Manish Goregaokar [Sun, 7 Apr 2019 19:39:43 +0000 (12:39 -0700)]
Remove libtest from deps

5 years agoRe-allow clippy::identity_conversion in compiletest
Manish Goregaokar [Sun, 7 Apr 2019 19:07:20 +0000 (12:07 -0700)]
Re-allow clippy::identity_conversion in compiletest

5 years agoUse latest compiletest-rs
Manish Goregaokar [Sun, 7 Apr 2019 19:02:22 +0000 (12:02 -0700)]
Use latest compiletest-rs

5 years agoRevert tests/compile-test.rs to 61aa5c957c219abe1fb2d1b5e51db8b365b4f565
Manish Goregaokar [Sun, 7 Apr 2019 19:01:39 +0000 (12:01 -0700)]
Revert tests/compile-test.rs to 61aa5c957c219abe1fb2d1b5e51db8b365b4f565

5 years agoFix ICE in suspicious_else_formatting
Philipp Hansch [Sun, 7 Apr 2019 09:11:06 +0000 (11:11 +0200)]
Fix ICE in suspicious_else_formatting

5 years agoMerge pull request #3918 from matthiaskrgr/typos
Matthias Krüger [Sun, 7 Apr 2019 08:29:51 +0000 (10:29 +0200)]
Merge pull request #3918 from matthiaskrgr/typos

NFC: fix typos