Skip to content

Commit 87ec058

Browse files
authored
Merge branch 'master' into version_ids
2 parents 617d861 + 42da194 commit 87ec058

36 files changed

+513
-421
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ matrix:
5252
- os: windows
5353
env: BASE_TEST=true
5454
- env: INTEGRATION=rust-lang/cargo
55-
- env: INTEGRATION=rust-lang-nursery/rand
55+
- env: INTEGRATION=rust-random/rand
5656
- env: INTEGRATION=rust-lang-nursery/stdsimd
57-
- env: INTEGRATION=rust-lang-nursery/rustfmt
57+
- env: INTEGRATION=rust-lang/rustfmt
5858
- env: INTEGRATION=rust-lang-nursery/futures-rs
5959
- env: INTEGRATION=rust-lang-nursery/failure
6060
- env: INTEGRATION=rust-lang-nursery/log
6161
- env: INTEGRATION=rust-lang-nursery/chalk
62-
- env: INTEGRATION=rust-lang-nursery/rls
62+
- env: INTEGRATION=rust-lang/rls
6363
- env: INTEGRATION=chronotope/chrono
6464
- env: INTEGRATION=serde-rs/serde
6565
- env: INTEGRATION=Geal/nom

CHANGELOG.md

+298-298
Large diffs are not rendered by default.

CONTRIBUTING.md

+23-11
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,27 @@ High level approach:
3535

3636
All issues on Clippy are mentored, if you want help with a bug just ask @Manishearth, @llogiq, @mcarton or @oli-obk.
3737

38-
Some issues are easier than others. The [`good first issue`](https://github.com/rust-lang-nursery/rust-clippy/labels/good%20first%20issue)
38+
Some issues are easier than others. The [`good first issue`](https://github.com/rust-lang/rust-clippy/labels/good%20first%20issue)
3939
label can be used to find the easy issues. If you want to work on an issue, please leave a comment
4040
so that we can assign it to you!
4141

42-
Issues marked [`T-AST`](https://github.com/rust-lang-nursery/rust-clippy/labels/T-AST) involve simple
42+
Issues marked [`T-AST`](https://github.com/rust-lang/rust-clippy/labels/T-AST) involve simple
4343
matching of the syntax tree structure, and are generally easier than
44-
[`T-middle`](https://github.com/rust-lang-nursery/rust-clippy/labels/T-middle) issues, which involve types
44+
[`T-middle`](https://github.com/rust-lang/rust-clippy/labels/T-middle) issues, which involve types
4545
and resolved paths.
4646

47-
[`T-AST`](https://github.com/rust-lang-nursery/rust-clippy/labels/T-AST) issues will generally need you to match against a predefined syntax structure. To figure out
47+
[`T-AST`](https://github.com/rust-lang/rust-clippy/labels/T-AST) issues will generally need you to match against a predefined syntax structure. To figure out
4848
how this syntax structure is encoded in the AST, it is recommended to run `rustc -Z ast-json` on an
4949
example of the structure and compare with the
5050
[nodes in the AST docs](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/ast). Usually
5151
the lint will end up to be a nested series of matches and ifs,
52-
[like so](https://github.com/rust-lang-nursery/rust-clippy/blob/de5ccdfab68a5e37689f3c950ed1532ba9d652a0/src/misc.rs#L34).
52+
[like so](https://github.com/rust-lang/rust-clippy/blob/de5ccdfab68a5e37689f3c950ed1532ba9d652a0/src/misc.rs#L34).
5353

54-
[`E-medium`](https://github.com/rust-lang-nursery/rust-clippy/labels/E-medium) issues are generally
54+
[`E-medium`](https://github.com/rust-lang/rust-clippy/labels/E-medium) issues are generally
5555
pretty easy too, though it's recommended you work on an E-easy issue first. They are mostly classified
5656
as `E-medium`, since they might be somewhat involved code wise, but not difficult per-se.
5757

58-
[`T-middle`](https://github.com/rust-lang-nursery/rust-clippy/labels/T-middle) issues can
58+
[`T-middle`](https://github.com/rust-lang/rust-clippy/labels/T-middle) issues can
5959
be more involved and require verifying types. The
6060
[`ty`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty) module contains a
6161
lot of methods that are useful, though one of the most useful would be `expr_ty` (gives the type of
@@ -152,6 +152,18 @@ Manually testing against an example file is useful if you have added some
152152
local modifications, run `env CLIPPY_TESTS=true cargo run --bin clippy-driver -- -L ./target/debug input.rs`
153153
from the working copy root.
154154

155+
### Linting Clippy with your changes locally
156+
157+
Clippy CI only passes if all lints defined in the version of the Clippy being
158+
tested pass (that is, don’t report any suggestions). You can avoid prolonging
159+
the CI feedback cycle for PRs you submit by running these lints yourself ahead
160+
of time and addressing any issues found:
161+
162+
```
163+
cargo build
164+
`pwd`/target/debug/cargo-clippy clippy --all-targets --all-features -- -D clippy::all -D clippy::internal -D clippy::pedantic
165+
```
166+
155167
### How Clippy works
156168

157169
Clippy is a [rustc compiler plugin][compiler_plugin]. The main entry point is at [`src/lib.rs`][main_entry]. In there, the lint registration is delegated to the [`clippy_lints`][lint_crate] crate.
@@ -237,10 +249,10 @@ All code in this repository is under the [Mozilla Public License, 2.0](https://w
237249

238250
<!-- adapted from https://github.com/servo/servo/blob/master/CONTRIBUTING.md -->
239251

240-
[main_entry]: https://github.com/rust-lang-nursery/rust-clippy/blob/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/src/lib.rs#L14
241-
[lint_crate]: https://github.com/rust-lang-nursery/rust-clippy/tree/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/clippy_lints/src
242-
[lint_crate_entry]: https://github.com/rust-lang-nursery/rust-clippy/blob/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/clippy_lints/src/lib.rs
243-
[else_if_without_else]: https://github.com/rust-lang-nursery/rust-clippy/blob/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/clippy_lints/src/else_if_without_else.rs
252+
[main_entry]: https://github.com/rust-lang/rust-clippy/blob/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/src/lib.rs#L14
253+
[lint_crate]: https://github.com/rust-lang/rust-clippy/tree/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/clippy_lints/src
254+
[lint_crate_entry]: https://github.com/rust-lang/rust-clippy/blob/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/clippy_lints/src/lib.rs
255+
[else_if_without_else]: https://github.com/rust-lang/rust-clippy/blob/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/clippy_lints/src/else_if_without_else.rs
244256
[compiler_plugin]: https://doc.rust-lang.org/unstable-book/language-features/plugin.html#lint-plugins
245257
[plugin_registry]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_plugin/registry/struct.Registry.html
246258
[reg_early_lint_pass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_plugin/registry/struct.Registry.html#method.register_early_lint_pass

Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ authors = [
99
"Oliver Schneider <[email protected]>"
1010
]
1111
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
12-
repository = "https://github.com/rust-lang-nursery/rust-clippy"
12+
repository = "https://github.com/rust-lang/rust-clippy"
1313
readme = "README.md"
1414
license = "MIT/Apache-2.0"
1515
keywords = ["clippy", "lint", "plugin"]
@@ -19,8 +19,8 @@ edition = "2018"
1919
publish = false
2020

2121
[badges]
22-
travis-ci = { repository = "rust-lang-nursery/rust-clippy" }
23-
appveyor = { repository = "rust-lang-nursery/rust-clippy" }
22+
travis-ci = { repository = "rust-lang/rust-clippy" }
23+
appveyor = { repository = "rust-lang/rust-clippy" }
2424

2525
[lib]
2626
name = "clippy"

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ We are currently in the process of discussing Clippy 1.0 via the RFC process in
22

33
# Clippy
44

5-
[![Build Status](https://travis-ci.org/rust-lang-nursery/rust-clippy.svg?branch=master)](https://travis-ci.org/rust-lang-nursery/rust-clippy)
5+
[![Build Status](https://travis-ci.org/rust-lang/rust-clippy.svg?branch=master)](https://travis-ci.org/rust-lang/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)
77
[![Current Version](https://meritbadge.herokuapp.com/clippy)](https://crates.io/crates/clippy)
88
[![License: MIT/Apache-2.0](https://img.shields.io/crates/l/clippy.svg)](#license)
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 288 lints included in this crate!](https://rust-lang-nursery.github.io/rust-clippy/master/index.html)
12+
[There are 288 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
1313

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

@@ -22,7 +22,7 @@ We have a bunch of lint categories to allow you to choose how much Clippy is sup
2222
* `clippy::cargo` (checks against the cargo manifest)
2323
* **`clippy::correctness`** (code that is just outright wrong or very very useless)
2424

25-
More to come, please [file an issue](https://github.com/rust-lang-nursery/rust-clippy/issues) if you have ideas!
25+
More to come, please [file an issue](https://github.com/rust-lang/rust-clippy/issues) if you have ideas!
2626

2727
Only the following of those categories are enabled by default:
2828

@@ -84,7 +84,7 @@ in your code, you can use:
8484
cargo run --bin cargo-clippy --manifest-path=path_to_clippys_Cargo.toml
8585
```
8686

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

9090
### Travis CI
@@ -117,7 +117,7 @@ blacklisted-names = ["toto", "tata", "titi"]
117117
cyclomatic-complexity-threshold = 30
118118
```
119119

120-
See the [list of lints](https://rust-lang-nursery.github.io/rust-clippy/master/index.html) for more information about which lints can be configured and the
120+
See the [list of lints](https://rust-lang.github.io/rust-clippy/master/index.html) for more information about which lints can be configured and the
121121
meaning of the variables.
122122

123123
To deactivate the “for further information visit *lint-link*” message you can

clippy_dev/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ lazy_static! {
3232
"(?P<desc>(?:[^"\\]+|\\(?s).(?-s))*)"\s*[})]
3333
"#).unwrap();
3434
static ref NL_ESCAPE_RE: Regex = Regex::new(r#"\\\n\s*"#).unwrap();
35-
pub static ref DOCS_LINK: String = "https://rust-lang-nursery.github.io/rust-clippy/master/index.html".to_string();
35+
pub static ref DOCS_LINK: String = "https://rust-lang.github.io/rust-clippy/master/index.html".to_string();
3636
}
3737

3838
/// Lint data parsed from the Clippy source code.

clippy_dev/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ fn update_lints(update_mode: &UpdateMode) {
8282

8383
let mut file_change = replace_region_in_file(
8484
"../README.md",
85-
r#"\[There are \d+ lints included in this crate!\]\(https://rust-lang-nursery.github.io/rust-clippy/master/index.html\)"#,
85+
r#"\[There are \d+ lints included in this crate!\]\(https://rust-lang.github.io/rust-clippy/master/index.html\)"#,
8686
"",
8787
true,
8888
update_mode == &UpdateMode::Change,
8989
|| {
9090
vec![
91-
format!("[There are {} lints included in this crate!](https://rust-lang-nursery.github.io/rust-clippy/master/index.html)", lint_count)
91+
format!("[There are {} lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)", lint_count)
9292
]
9393
}
9494
).changed;

clippy_dummy/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ readme = "crates-readme.md"
77
description = "A bunch of helpful lints to avoid common pitfalls in Rust."
88
build = 'build.rs'
99

10-
repository = "https://github.com/rust-lang-nursery/rust-clippy"
10+
repository = "https://github.com/rust-lang/rust-clippy"
1111

1212
license = "MIT/Apache-2.0"
1313
keywords = ["clippy", "lint", "plugin"]

clippy_dummy/crates-readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ rustup component add clippy-preview
66

77
on a Rust version 1.29 or later. You may need to run `rustup self update` if it complains about a missing clippy binary.
88

9-
See [the homepage](https://github.com/rust-lang-nursery/rust-clippy/#clippy) for more information
9+
See [the homepage](https://github.com/rust-lang/rust-clippy/#clippy) for more information

clippy_lints/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ authors = [
1010
"Martin Carton <[email protected]>"
1111
]
1212
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
13-
repository = "https://github.com/rust-lang-nursery/rust-clippy"
13+
repository = "https://github.com/rust-lang/rust-clippy"
1414
readme = "README.md"
1515
license = "MPL-2.0"
1616
keywords = ["clippy", "lint", "plugin"]

clippy_lints/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
This crate contains Clippy lints. For the main crate, check
22
[*crates.io*](https://crates.io/crates/clippy) or
3-
[GitHub](https://github.com/rust-lang-nursery/rust-clippy).
3+
[GitHub](https://github.com/rust-lang/rust-clippy).

clippy_lints/src/attrs.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ declare_clippy_lint! {
177177
///
178178
/// **Known problems:** This lint doesn't detect crate level inner attributes, because they get
179179
/// processed before the PreExpansionPass lints get executed. See
180-
/// [#3123](https://github.com/rust-lang-nursery/rust-clippy/pull/3123#issuecomment-422321765)
180+
/// [#3123](https://github.com/rust-lang/rust-clippy/pull/3123#issuecomment-422321765)
181181
///
182182
/// **Example:**
183183
///
@@ -537,4 +537,3 @@ impl EarlyLintPass for CfgAttrPass {
537537
}
538538
}
539539
}
540-

clippy_lints/src/cargo_common_metadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use cargo_metadata;
3131
/// name = "clippy"
3232
/// version = "0.0.212"
3333
/// description = "A bunch of helpful lints to avoid common pitfalls in Rust"
34-
/// repository = "https://github.com/rust-lang-nursery/rust-clippy"
34+
/// repository = "https://github.com/rust-lang/rust-clippy"
3535
/// readme = "README.md"
3636
/// license = "MIT/Apache-2.0"
3737
/// keywords = ["clippy", "lint", "plugin"]

clippy_lints/src/copies.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ declare_clippy_lint! {
8080
///
8181
/// **Known problems:** False positive possible with order dependent `match`
8282
/// (see issue
83-
/// [#860](https://github.com/rust-lang-nursery/rust-clippy/issues/860)).
83+
/// [#860](https://github.com/rust-lang/rust-clippy/issues/860)).
8484
///
8585
/// **Example:**
8686
/// ```rust,ignore

clippy_lints/src/escape.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
8787

8888
let mut v = EscapeDelegate {
8989
cx,
90-
set: NodeSet(),
90+
set: NodeSet::default(),
9191
too_large_for_stack: self.too_large_for_stack,
9292
};
9393

clippy_lints/src/eta_reduction.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub struct EtaPass;
2828
/// **Known problems:** If creating the closure inside the closure has a side-
2929
/// effect then moving the closure creation out will change when that side-
3030
/// effect runs.
31-
/// See https://github.com/rust-lang-nursery/rust-clippy/issues/1439 for more
31+
/// See https://github.com/rust-lang/rust-clippy/issues/1439 for more
3232
/// details.
3333
///
3434
/// **Example:**

clippy_lints/src/new_without_default.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
141141
if let Some(default_trait_id) = get_trait_def_id(cx, &paths::DEFAULT_TRAIT);
142142
then {
143143
if self.impling_types.is_none() {
144-
let mut impls = NodeSet();
144+
let mut impls = NodeSet::default();
145145
cx.tcx.for_each_impl(default_trait_id, |d| {
146146
if let Some(ty_def) = cx.tcx.type_of(d).ty_adt_def() {
147147
if let Some(node_id) = cx.tcx.hir.as_local_node_id(ty_def.did) {

0 commit comments

Comments
 (0)