Skip to content

Commit cfc9b33

Browse files
committed
Merge branch 'master' into typos
2 parents 949f0d9 + fde487c commit cfc9b33

File tree

168 files changed

+2648
-2129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+2648
-2129
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ matrix:
4848
- env: INTEGRATION=serde-rs/serde
4949
- env: INTEGRATION=Geal/nom
5050
- env: INTEGRATION=hyperium/hyper
51-
- env: INTEGRATION=rust-lang/cargo
52-
- env: INTEGRATION=rust-lang-nursery/rls
5351

5452
script:
5553
- |

CHANGELOG.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## 0.0.212
5+
* Rustup to *rustc 1.29.0-nightly (e06c87544 2018-07-06)*
6+
47
## 0.0.211
58
* Rustup to *rustc 1.28.0-nightly (e3bf634e0 2018-06-28)*
69

@@ -504,7 +507,7 @@ All notable changes to this project will be documented in this file.
504507
## 0.0.74 — 2016-06-07
505508
* Fix bug with `cargo-clippy` JSON parsing
506509
* Add the `CLIPPY_DISABLE_DOCS_LINKS` environment variable to deactivate the
507-
“for further information visit *wiki-link*” message.
510+
“for further information visit *lint-link*” message.
508511

509512
## 0.0.73 — 2016-06-05
510513
* Fix false positives in [`useless_let_if_seq`]
@@ -609,7 +612,7 @@ All notable changes to this project will be documented in this file.
609612
[`AsRef`]: https://doc.rust-lang.org/std/convert/trait.AsRef.html
610613
[configuration file]: ./rust-clippy#configuration
611614

612-
<!-- begin autogenerated links to wiki -->
615+
<!-- begin autogenerated links to lint list -->
613616
[`absurd_extreme_comparisons`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#absurd_extreme_comparisons
614617
[`almost_swapped`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#almost_swapped
615618
[`approx_constant`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#approx_constant
@@ -744,6 +747,7 @@ All notable changes to this project will be documented in this file.
744747
[`misaligned_transmute`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#misaligned_transmute
745748
[`misrefactored_assign_op`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#misrefactored_assign_op
746749
[`missing_docs_in_private_items`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
750+
[`missing_inline_in_public_items`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
747751
[`mixed_case_hex_literals`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#mixed_case_hex_literals
748752
[`module_inception`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#module_inception
749753
[`modulo_one`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#modulo_one
@@ -890,4 +894,4 @@ All notable changes to this project will be documented in this file.
890894
[`zero_prefixed_literal`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#zero_prefixed_literal
891895
[`zero_ptr`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#zero_ptr
892896
[`zero_width_space`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#zero_width_space
893-
<!-- end autogenerated links to wiki -->
897+
<!-- end autogenerated links to lint list -->

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to rust-clippy
1+
# Contributing to Clippy
22

33
Hello fellow Rustacean! Great to see your interest in compiler internals and lints!
44

@@ -63,7 +63,7 @@ an AST expression). `match_def_path()` in Clippy's `utils` module can also be us
6363

6464
## Writing code
6565

66-
Compiling clippy from scratch can take almost a minute or more depending on your machine.
66+
Compiling Clippy from scratch can take almost a minute or more depending on your machine.
6767
However, since Rust 1.24.0 incremental compilation is enabled by default and compile times for small changes should be quick.
6868

6969
[Llogiq's blog post on lints](https://llogiq.github.io/2015/06/04/workflows.html) is a nice primer
@@ -74,7 +74,7 @@ of this.
7474

7575
### Author lint
7676

77-
There is also the internal `author` lint to generate clippy code that detects the offending pattern. It does not work for all of the Rust syntax, but can give a good starting point.
77+
There is also the internal `author` lint to generate Clippy code that detects the offending pattern. It does not work for all of the Rust syntax, but can give a good starting point.
7878

7979
First, create a new UI test file in the `tests/ui/` directory with the pattern you want to match:
8080

@@ -93,9 +93,9 @@ a `.stdout` file with the generated code:
9393
// ./tests/ui/my_lint.stdout
9494

9595
if_chain! {
96-
if let Expr_::ExprArray(ref elements) = stmt.node;
96+
if let ExprKind::Array(ref elements) = stmt.node;
9797
if elements.len() == 1;
98-
if let Expr_::ExprLit(ref lit) = elements[0].node;
98+
if let ExprKind::Lit(ref lit) = elements[0].node;
9999
if let LitKind::Int(7, _) = lit.node;
100100
then {
101101
// report your lint here
@@ -148,7 +148,7 @@ Therefore you should use `tests/ui/update-all-references.sh` (after running
148148
### Testing manually
149149

150150
Manually testing against an example file is useful if you have added some
151-
`println!`s and test suite output becomes unreadable. To try clippy with your
151+
`println!`s and test suite output becomes unreadable. To try Clippy with your
152152
local modifications, run `cargo run --bin clippy-driver -- -L ./target/debug input.rs` from the
153153
working copy root.
154154

@@ -179,7 +179,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
179179
```
180180

181181
The [`rustc_plugin::PluginRegistry`][plugin_registry] provides two methods to register lints: [register_early_lint_pass][reg_early_lint_pass] and [register_late_lint_pass][reg_late_lint_pass].
182-
Both take an object that implements an [`EarlyLintPass`][early_lint_pass] or [`LateLintPass`][late_lint_pass] respectively. This is done in every single lint.
182+
Both take an object that implements an [`EarlyLintPass`][early_lint_pass] or [`LateLintPass`][late_lint_pass] respectively. This is done in every single lint.
183183
It's worth noting that the majority of `clippy_lints/src/lib.rs` is autogenerated by `util/update_lints.py` and you don't have to add anything by hand. When you are writing your own lint, you can use that script to save you some time.
184184

185185
```rust

Cargo.toml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cargo-features = ["edition"]
22

33
[package]
44
name = "clippy"
5-
version = "0.0.211"
5+
version = "0.0.212"
66
authors = [
77
"Manish Goregaokar <[email protected]>",
88
"Andre Bogus <[email protected]>",
@@ -40,11 +40,51 @@ path = "src/driver.rs"
4040

4141
[dependencies]
4242
# begin automatic update
43-
clippy_lints = { version = "0.0.211", path = "clippy_lints" }
43+
clippy_lints = { version = "0.0.212", path = "clippy_lints" }
4444
# end automatic update
4545
regex = "1"
4646
semver = "0.9"
4747

48+
# Not actually needed right now but required to make sure that clippy/ and cargo build
49+
# with the same set of features in rust-lang/rust
50+
num-traits = "0.2" # enable the default feature
51+
backtrace = "0.3"
52+
53+
# keep in sync with `cargo`'s `Cargo.toml'
54+
[target.'cfg(windows)'.dependencies.winapi]
55+
version = "0.3"
56+
features = [
57+
# keep in sync with `cargo`'s `Cargo.toml'
58+
"handleapi",
59+
"jobapi",
60+
"jobapi2",
61+
"minwindef",
62+
"ntdef",
63+
"ntstatus",
64+
"processenv",
65+
"processthreadsapi",
66+
"psapi",
67+
"synchapi",
68+
"winerror",
69+
"winbase",
70+
"wincon",
71+
"winnt",
72+
# no idea where these come from
73+
"basetsd",
74+
"lmcons",
75+
"memoryapi",
76+
"minschannel",
77+
"minwinbase",
78+
"ntsecapi",
79+
"profileapi",
80+
"schannel",
81+
"securitybaseapi",
82+
"synchapi",
83+
"sysinfoapi",
84+
"timezoneapi",
85+
"wincrypt",
86+
]
87+
4888
[dev-dependencies]
4989
cargo_metadata = "0.5"
5090
compiletest_rs = "0.3.7"

PUBLISH.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
Steps to publish a new clippy version
1+
Steps to publish a new Clippy version
22

33
- Bump `package.version` in `./Cargo.toml` (no need to manually bump `dependencies.clippy_lints.version`).
44
- Write a changelog entry.
5+
- If a nightly update is needed, update `min_version.txt` using `rustc -vV > min_version.txt`
56
- Run `./pre_publish.sh`
67
- Review and commit all changed files
78
- `git push`

README.md

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
We are currently in the process of discussing Clippy 1.0 via the RFC process in https://github.com/rust-lang/rfcs/pull/2476 . The RFC's goal is to clarify policies around lint categorizations and the policy around which lints should be in the compiler and which lints should be in clippy. Please leave your thoughts on the RFC PR.
1+
We are currently in the process of discussing Clippy 1.0 via the RFC process in https://github.com/rust-lang/rfcs/pull/2476 . The RFC's goal is to clarify policies around lint categorizations and the policy around which lints should be in the compiler and which lints should be in Clippy. Please leave your thoughts on the RFC PR.
22

3-
# rust-clippy
3+
# Clippy
44

55
[![Build Status](https://travis-ci.org/rust-lang-nursery/rust-clippy.svg?branch=master)](https://travis-ci.org/rust-lang-nursery/rust-clippy)
66
[![Windows Build status](https://ci.appveyor.com/api/projects/status/id677xpw1dguo7iw?svg=true)](https://ci.appveyor.com/project/rust-lang-libs/rust-clippy)
@@ -9,9 +9,9 @@ We are currently in the process of discussing Clippy 1.0 via the RFC process in
99

1010
A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.
1111

12-
[There are 272 lints included in this crate!](https://rust-lang-nursery.github.io/rust-clippy/master/index.html)
12+
[There are 273 lints included in this crate!](https://rust-lang-nursery.github.io/rust-clippy/master/index.html)
1313

14-
We have a bunch of lint categories to allow you to choose how much clippy is supposed to ~~annoy~~ help you:
14+
We have a bunch of lint categories to allow you to choose how much Clippy is supposed to ~~annoy~~ help you:
1515

1616
* `clippy` (everything that has no false positives)
1717
* `clippy_pedantic` (everything)
@@ -33,57 +33,59 @@ Table of contents:
3333
## Usage
3434

3535
Since this is a tool for helping the developer of a library or application
36-
write better code, it is recommended not to include clippy as a hard dependency.
36+
write better code, it is recommended not to include Clippy as a hard dependency.
3737
Options include using it as an optional dependency, as a cargo subcommand, or
38-
as an included feature during build. All of these options are detailed below.
38+
as an included feature during build. These options are detailed below.
3939

40-
As a general rule clippy will only work with the *latest* Rust nightly for now.
40+
### As a cargo subcommand (`cargo clippy`)
4141

42-
To install Rust nightly, the recommended way is to use [rustup](https://rustup.rs/):
42+
One way to use Clippy is by installing Clippy through rustup as a cargo
43+
subcommand.
4344

44-
```terminal
45-
rustup install nightly
46-
```
45+
#### Step 1: Install rustup
4746

48-
### As a cargo subcommand (`cargo clippy`)
47+
You can install [rustup](http://rustup.rs/) on supported platforms. This will help
48+
us install clippy and its dependencies.
4949

50-
One way to use clippy is by installing clippy through cargo as a cargo
51-
subcommand.
50+
If you already have rustup installed, update to ensure you have the latest
51+
rustup and compiler:
5252

5353
```terminal
54-
cargo +nightly install clippy
54+
rustup update
5555
```
5656

57-
(The `+nightly` is not necessary if your default `rustup` install is nightly)
57+
#### Step 2: Install nightly toolchain
5858

59-
Now you can run clippy by invoking `cargo +nightly clippy`.
59+
Rustup integration is still new, you will need a relatively new nightly (2018-07-15 or later).
6060

61-
To update the subcommand together with the latest nightly use the [rust-update](rust-update) script or run:
61+
To install Rust nightly with [rustup](https://rustup.rs/):
6262

6363
```terminal
64-
rustup update nightly
65-
cargo +nightly install --force clippy
64+
rustup install nightly
6665
```
6766

68-
In case you are not using rustup, you need to set the environment flag
69-
`SYSROOT` during installation so clippy knows where to find `librustc` and
70-
similar crates.
67+
#### Step 3: Install clippy
68+
69+
Once you have rustup and the nightly toolchain installed, run the following command:
7170

7271
```terminal
73-
SYSROOT=/path/to/rustc/sysroot cargo install clippy
72+
rustup component add clippy-preview --toolchain=nightly
7473
```
7574

76-
### Running clippy from the command line without installing it
75+
Now you can run Clippy by invoking `cargo +nightly clippy`. If nightly is your
76+
default toolchain in rustup, `cargo clippy` will work fine.
77+
78+
### Running Clippy from the command line without installing it
7779

78-
To have cargo compile your crate with clippy without clippy installation
80+
To have cargo compile your crate with Clippy without Clippy installation
7981
in your code, you can use:
8082

8183
```terminal
8284
cargo run --bin cargo-clippy --manifest-path=path_to_clippys_Cargo.toml
8385
```
8486

8587
*[Note](https://github.com/rust-lang-nursery/rust-clippy/wiki#a-word-of-warning):*
86-
Be sure that clippy was compiled with the same version of rustc that cargo invokes here!
88+
Be sure that Clippy was compiled with the same version of rustc that cargo invokes here!
8789

8890
## Configuration
8991

@@ -117,7 +119,7 @@ You can add options to `allow`/`warn`/`deny`:
117119
Note: `deny` produces errors instead of warnings.
118120

119121
For convenience, `cargo clippy` automatically defines a `cargo-clippy`
120-
feature. This lets you set lint levels and compile with or without clippy
122+
feature. This lets you set lint levels and compile with or without Clippy
121123
transparently:
122124

123125
```rust
@@ -126,12 +128,12 @@ transparently:
126128

127129
## Updating rustc
128130

129-
Sometimes, rustc moves forward without clippy catching up. Therefore updating
130-
rustc may leave clippy a non-functional state until we fix the resulting
131+
Sometimes, rustc moves forward without Clippy catching up. Therefore updating
132+
rustc may leave Clippy a non-functional state until we fix the resulting
131133
breakage.
132134

133135
You can use the [rust-update](rust-update) script to update rustc only if
134-
clippy would also update correctly.
136+
Clippy would also update correctly.
135137

136138
## License
137139

build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//! This build script ensures that clippy is not compiled with an
1+
//! This build script ensures that Clippy is not compiled with an
22
//! incompatible version of rust. It will panic with a descriptive
33
//! error message instead.
44
//!
5-
//! We specifially want to ensure that clippy is only built with a
5+
//! We specifially want to ensure that Clippy is only built with a
66
//! rustc version that is newer or equal to the one specified in the
77
//! `min_version.txt` file.
88
//!
@@ -63,7 +63,7 @@ fn check_rustc_version() {
6363
eprintln!(
6464
"\n{} {}",
6565
Red.bold().paint("error:"),
66-
"clippy requires a nightly version of Rust."
66+
"Clippy requires a nightly version of Rust."
6767
);
6868
print_version_err(&current_version, &*current_date_str);
6969
eprintln!(
@@ -80,7 +80,7 @@ fn check_rustc_version() {
8080
eprintln!(
8181
"\n{} {}",
8282
Red.bold().paint("error:"),
83-
"clippy does not support this version of rustc nightly."
83+
"Clippy does not support this version of rustc nightly."
8484
);
8585
eprintln!(
8686
"> {}{}{}",

ci/base-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ cargo test --features debugging
66
mkdir -p ~/rust/cargo/bin
77
cp target/debug/cargo-clippy ~/rust/cargo/bin/cargo-clippy
88
cp target/debug/clippy-driver ~/rust/cargo/bin/clippy-driver
9+
rm ~/.cargo/bin/cargo-clippy
910
PATH=$PATH:~/rust/cargo/bin cargo clippy --all -- -D clippy
1011
cd clippy_workspace_tests && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ..
1112
cd clippy_workspace_tests/src && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ../..

ci/integration-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
set -x
2+
rm ~/.cargo/bin/cargo-clippy
23
cargo install --force --path .
34

45
echo "Running integration test for crate ${INTEGRATION}"

clippy_lints/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cargo-features = ["edition"]
33
[package]
44
name = "clippy_lints"
55
# begin automatic update
6-
version = "0.0.211"
6+
version = "0.0.212"
77
# end automatic update
88
authors = [
99
"Manish Goregaokar <[email protected]>",
@@ -21,8 +21,8 @@ edition = "2018"
2121
[dependencies]
2222
cargo_metadata = "0.5"
2323
itertools = "0.7"
24-
lazy_static = "1.0"
25-
matches = "0.1.2"
24+
lazy_static = "1.0.2"
25+
matches = "0.1.7"
2626
quine-mc_cluskey = "0.2.2"
2727
regex-syntax = "0.6"
2828
semver = "0.9.0"
@@ -32,7 +32,7 @@ toml = "0.4"
3232
unicode-normalization = "0.1"
3333
pulldown-cmark = "0.1"
3434
url = "1.7.0"
35-
if_chain = "0.1"
35+
if_chain = "0.1.3"
3636

3737
[features]
3838
debugging = []

0 commit comments

Comments
 (0)