Commit Graph

6409 Commits

Author SHA1 Message Date
Michael Wright
fd9c5a3c71 Merge branch 'master' into dev-fmt-20190728 2019-08-01 07:02:48 +02:00
bors
d1b4fc9853 Auto merge of #4313 - Manishearth:owl, r=yaahallo
Don't nudge people towards toilet closures when producing owl results

`.map_err(drop)` should never be linted since sometimes you want to produce `Result<(), ()>` and the alternative is `.map_err(|_| ())`, which can be ugly. We don't seem to, but it's good to specifically test for this.

changelog: none

r? @yaahallo
2019-07-31 17:57:57 +00:00
Manish Goregaokar
38e7bd20f2 Don't nudge people towards toilet closures when producing owl results 2019-07-31 09:10:34 -07:00
bors
128647d821 Auto merge of #4308 - jakubadamw:use-self-variant-scope, r=flip1995
Extend the `use_self` lint to suggest uses of `Self::Variant`

Fixes #4296.

changelog: Extend the `use_self` lint to suggest uses of `Self::Variant`
2019-07-31 14:50:01 +00:00
Jakub Wieczorek
2a13e83f2b Update all the code to pass the updated use_self lint.
One struct required a temporary `#[allow(dead_code)]` annotation due to
a bug in the Rust compiler: https://github.com/rust-lang/rust/issues/63151.
2019-07-31 08:50:43 +00:00
Jakub Wieczorek
41110b0039 Extend the use_self lint to suggest uses of Self::Variant. 2019-07-31 08:50:43 +00:00
bors
c3e913650e Auto merge of #3766 - xd009642:issue-3764, r=flip1995
trait bounds lint - repeated types

This PR is to tackle https://github.com/rust-lang/rust-clippy/issues/3764 it's still a WIP and doesn't work but this is an initial stab. It builds though I haven't added any tests as I'm not sure where lint tests should go?

Unfortunately, it seems id isn't tied to the type itself but I guess where it is in the AST? Looking at https://manishearth.github.io/rust-internals-docs/syntax/ast/struct.Ty.html I can't see any members that would let me tell if a type was repeated in multiple trait bounds.

There may be other issues with how I've implemented this so any assistance is appreciated!

changelog: Add new lint: `type_repetition_in_bounds`
2019-07-30 12:11:17 +00:00
bors
e7d153a4ab Auto merge of #4306 - mikerite:fix-breakage-20190730, r=flip1995
Fix breakage due to rust-lang/rust#61856

changelog: none
2019-07-30 08:57:29 +00:00
Michael Wright
2f5c1d031d Fix breakage due to rust-lang/rust#61856 2019-07-30 06:39:51 +02:00
Michael Wright
2682bd112e Correct typo 2019-07-29 07:54:03 +02:00
Michael Wright
82be293dfd Make appveyor build ignore rustfmt unavailability 2019-07-29 07:51:44 +02:00
xd009642
78ebcaa526 Fix dogfood test 2019-07-28 09:31:05 +01:00
Michael Wright
a9714227bd Enable rustfmt tests
This reverts commit d73a953db7.
2019-07-28 06:45:23 +02:00
Michael Wright
dae4076760 Skip fmt test if rustfmt is unavailble 2019-07-28 06:45:09 +02:00
Michael Wright
cc779c8050 dev-fmt: better error handling
Check if rustfmt is installed at the start and exit if it isn't.
2019-07-28 06:41:13 +02:00
xd009642
03c543515a Hash discriminant of lifetime.name 2019-07-27 23:04:36 +01:00
xd009642
ad637193f0 Hash discriminant of Lifetime::Name 2019-07-27 22:59:46 +01:00
xd009642
bba2c7f02c Updated tests.
Removed unnecessary type repetition in float test and regenerated stderr
Regenerated type_repetition stderr
2019-07-27 22:53:26 +01:00
xd009642
925e8207fa Respond to review comments
Update README and CHANGELOG using the util scripts, refine the help message and fix the float_cmp error.
2019-07-27 21:58:29 +01:00
bors
dc69a5c0b6 Auto merge of #4301 - flip1995:dummy, r=Manishearth
Bump version of clippy_dummy

The crates.io page of clippy still suggest to install `clippy-preview`
instead of `clippy` I think it's time to change this.

Thanks to the Stuttgart Meetup for discovering this!

r? @Manishearth could you also publish this after merging?

changelog: none
2019-07-27 16:53:00 +00:00
bors
5441cf26a0 Auto merge of #4302 - matthiaskrgr:rustup_13, r=phansch
rustup https://github.com/rust-lang/rust/pull/62964

changelog: none
2019-07-27 15:52:14 +00:00
Matthias Krüger
d73a953db7 ci: temporarily disable rustfmt checks/tetss since it's broken for nightly 2019-07-27 17:47:51 +02:00
xd009642
c962ddbd29 Updated test stderr 2019-07-27 12:07:02 +01:00
xd009642
5e9906b2c6 Added doc comment fixed type printout
Added a doc comment for the lint and fixed the printout of the type so it prints T not type(T)
2019-07-27 12:06:25 +01:00
xd009642
cac69ec063 Respond to comments and improve printout
Now get the trait names for the diagnostic message and removed more
`let c: fn(_) -> _ = T; hashes from hir_utils
2019-07-27 11:51:27 +01:00
Matthias Krüger
f195550148 rustup https://github.com/rust-lang/rust/pull/62964 2019-07-26 22:58:31 +02:00
flip1995
0fe6003dff
Bump version of clippy_dummy
The crates.io page of clippy still suggest to install `clippy-preview`
instead of `clippy` I think it's time to change this.

Thanks to the Stuttgart Meetup for discovering this!
2019-07-26 21:01:18 +02:00
xd009642
7853dac662 Responded to comments and fixed compile bug
Removed the hash of `let c: fn(_,_) -> _ = ExprKind::Cast` and
fixed compile issue by collecting HirVec into an actual Vec
2019-07-26 16:46:47 +01:00
xd009642
c0259179c3 Fixed more compile errors
Moved to rustc::hir::Ty
2019-07-24 22:59:32 +01:00
xd009642
792153104c Fix some of the compile errors 2019-07-24 22:27:12 +01:00
xd009642
f3e4467c10 Changed Ty to ty, added lifetime 'tcx 2019-07-24 21:14:21 +01:00
xd009642
f71d59e6a6 Lint for type repetition in trait bounds.
This lint adds warning if types are redundantly repeated in trait bounds i.e. `T: Copy, T: Clone` instead of `T: Copy + Clone`. This is a late pass trait lint and has necessitated the addition of code to allow hashing of TyKinds without taking into account Span information.
2019-07-24 21:14:21 +01:00
bors
f8e04ff397 Auto merge of #4297 - matthiaskrgr:rustup_12, r=matthiaskrgr
rustup

changelog: none
2019-07-24 04:56:28 +00:00
Matthias Krüger
b0373a5f6b update test stderr, not sure which rustc pull request caused this. 2019-07-24 02:25:03 +02:00
Matthias Krüger
2221fc8124 rustup https://github.com/rust-lang/rust/pull/62859 2019-07-24 02:20:36 +02:00
bors
d71e9c4f10 Auto merge of #4266 - uHOOCCOOHu:fix/async_fn_lifetime, r=flip1995
Ignore generated fresh lifetimes in elision check

<!--
Thank you for making Clippy better!

We're collecting our changelog from pull request descriptions.
If your PR only updates to the latest nightly, you can leave the
`changelog` entry as `none`. Otherwise, please write a short comment
explaining your change.

If your PR fixes an issue, you can add "fixes #issue_number" into this
PR description. This way the issue will be automatically closed when
your PR is merged.

If you added a new lint, here's a checklist for things that will be
checked during review or continuous integration.

- [ ] Followed [lint naming conventions][lint_naming]
- [ ] Added passing UI tests (including committed `.stderr` file)
- [ ] `cargo test` passes locally
- [ ] Executed `util/dev update_lints`
- [ ] Added lint documentation
- [ ] Run `cargo fmt`

Note that you can skip the above if you are just opening a WIP PR in
order to get feedback.

Delete this line and everything above before opening your PR -->

fixes #3988

changelog: Ignore generated fresh lifetimes in elision check.

**HELP**: It seems `tests/ui` are compiled under edition 2015, and I don't know how to add tests for this properly.

Here is the test input it had already passed:
```rust
#![feature(async_await)]
#![allow(dead_code)]

async fn sink1<'a>(_: &'a str) {} // lint
async fn sink1_elided(_: &str) {} // ok

async fn one_to_one<'a>(s: &'a str) -> &'a str { s } // lint
async fn one_to_one_elided(s: &str) -> &str { s } // ok
async fn all_to_one<'a>(a: &'a str, _b: &'a str) -> &'a str { a } // ok
// async fn unrelated(_: &str, _: &str) {} // Not allowed in async fn

// #3988
struct Foo;
impl Foo {
    pub async fn foo(&mut self) {} // ok
}

// rust-lang/rust#61115
async fn print(s: &str) { // ok
    println!("{}", s);
}

fn main() {}

```
2019-07-23 09:52:18 +00:00
uHOOCCOOHu
5265ab8723
Fix tests for edition 2018 compatibility 2019-07-23 03:59:09 +08:00
uHOOCCOOHu
434f83a6c7
Revert "Revert global fmt config and use rustfmt::skip"
This reverts commit b70b3b14aa.
2019-07-23 02:57:49 +08:00
bors
49ff0d9d6c Auto merge of #4292 - mikerite:fix-breakage-20190721, r=matthiaskrgr
Fix breakage due to rust-lang/rust#62705

Also rename `OUTER_EXPN_INFO` to `OUTER_EXPN_EXPN_INFO` to match new
function names.

changelog: none
2019-07-21 13:48:30 +00:00
Michael Wright
f05e295685 Fix breakage due to rust-lang/rust#60913 2019-07-21 12:52:14 +02:00
Michael Wright
67db88f645 Fix breakage due to rust-lang/rust#62705
Also rename `OUTER_EXPN_INFO` to `OUTER_EXPN_EXPN_INFO` to match new
function names.
2019-07-21 09:36:31 +02:00
uHOOCCOOHu
b70b3b14aa
Revert global fmt config and use rustfmt::skip 2019-07-20 00:50:18 +08:00
uHOOCCOOHu
2cc373ac54
Fix fmt 2019-07-19 23:03:34 +08:00
bors
bd4c4e7e73 Auto merge of #4287 - matthiaskrgr:rustup_11, r=phansch
rustup https://github.com/rust-lang/rust/pull/62679/

changelog: none
2019-07-19 14:44:36 +00:00
Matthias Krüger
a865fe607c rustup https://github.com/rust-lang/rust/pull/62679/ 2019-07-19 16:41:10 +02:00
bors
958af10f12 Auto merge of #4286 - phansch:update_pulldown_cmark3, r=flip1995
Update pulldown-cmark to 0.5.3

Fixes a couple of crashes of which I added one example to our tests.

changelog: Update `pulldown-cmark` to 0.5.3 to fix potential crashes in `doc_markdown` lint
2019-07-19 07:25:55 +00:00
bors
e5f2330238 Auto merge of #4285 - matthiaskrgr:rustup_backticks, r=phansch
rustup https://github.com/rust-lang/rust/pull/62764

(was merged as part of https://github.com/rust-lang/rust/pull/62782 )

changelog: none
2019-07-19 05:31:31 +00:00
Philipp Hansch
8dc6a462f8
Update pulldown-cmark to 0.5.3 2019-07-19 07:29:25 +02:00
Matthias Krüger
deb586a0c6 rustup https://github.com/rust-lang/rust/pull/62764
(was merged as part of https://github.com/rust-lang/rust/pull/62782 )
2019-07-19 00:35:32 +02:00
bors
c46727319e Auto merge of #4282 - phansch:decrease_stderr_maximum_length, r=flip1995
Decrease maximum length for stderr files

Now at 275.

changelog: none

cc #2038
2019-07-18 18:57:32 +00:00