Skip to content

Commit

Permalink
submodules: update clippy from c63b634 to 1b89724
Browse files Browse the repository at this point in the history
Changes:
````
Really fix issue number in `map_clone` test
Fix issue number in `map_clone` test
Remove `map_clone` fixed known problem
Fix `map_clone` bad suggestion
Add run-rustfix to unnecessary_fold
Add run-rustfix to unit_arg test
Add run-rustfix for types test
Add run-rustfix to starts_ends_with
Add run-rustfix to replace_const test
Add run-rustfix to redundant_field_names
Missing docs: don't require documenting Global Asm items.
Add run-rustfix for precedence test
Add run-rustfix to mem_replace test
Add run-rustfix to map_clone test
Add run-rustfix to large_digit_groups
Add run-rustfix to into_iter_on_ref
Add run-rustfix to infallible_destructuring_match
Add rustfix to inconsistent_digit_grouping test
Add run-rustfix to explicit_write test
Add run-rustfix to excessive_precision test
Add run-rustfix to duration_subsec test
Disable deprecated_cfg_attr lint for inner attributes
Add run-rustfix to collapsible_if test
Update Readme
Update Readme for (arguably) better readability
rustup: the features if_while_or_patterns has been stabilized
Fix comments in clippy_lints/src/len_zero.rs
readme: update travis badge to reflect migration from travis-ci.org to travis-ci.com
Remove all copyright license headers
Move cast_ref_to_mut list to correctness group
Rustftmt
Don't import ty::Ref in cast_ref_to_mut lint
Move a hint to an error message in cast_ref_to_mut lint
Add a note to cast_ref_to_mut lint
Use ty::Ref instead of ty::TyKind::Ref
cast_ref_to_mut lint
Add missing ` in default lint
Improve tests and exclude nested impls
Update `unwrap_get` code review suggestions
Update known problems
Restrict use_self on nested items
Improve `get_unwrap` suggestion
````
  • Loading branch information
matthiaskrgr committed Jan 15, 2019
1 parent 209696d commit eba7337
Show file tree
Hide file tree
Showing 695 changed files with 3,512 additions and 6,357 deletions.
11 changes: 0 additions & 11 deletions .github/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
#!/bin/bash

# Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.


# Automatically deploy on gh-pages

set -ex
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ All notable changes to this project will be documented in this file.
[`cast_possible_wrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
[`cast_precision_loss`]: https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
[`cast_ptr_alignment`]: https://rust-lang.github.io/rust-clippy/master/index.html#cast_ptr_alignment
[`cast_ref_to_mut`]: https://rust-lang.github.io/rust-clippy/master/index.html#cast_ref_to_mut
[`cast_sign_loss`]: https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
[`char_lit_as_u8`]: https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
[`chars_last_cmp`]: https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp
Expand Down
2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2014-2018 The Rust Project Developers
Copyright 2014-2019 The Rust Project Developers

Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Clippy

[![Build Status](https://travis-ci.org/rust-lang/rust-clippy.svg?branch=master)](https://travis-ci.org/rust-lang/rust-clippy)
[![Build Status](https://travis-ci.com/rust-lang/rust-clippy.svg?branch=master)](https://travis-ci.com/rust-lang/rust-clippy)
[![Windows Build status](https://ci.appveyor.com/api/projects/status/id677xpw1dguo7iw?svg=true)](https://ci.appveyor.com/project/rust-lang-libs/rust-clippy)
[![Current Version](https://meritbadge.herokuapp.com/clippy)](https://crates.io/crates/clippy)
[![License: MIT/Apache-2.0](https://img.shields.io/crates/l/clippy.svg)](#license)

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

[There are 290 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
[There are 291 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)

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

Expand Down Expand Up @@ -68,10 +68,15 @@ Once you have rustup and the latest stable release (at least Rust 1.29) installe
```terminal
rustup component add clippy
```
If it says that it can't find the `clippy` component, please run `rustup self update`.

Now you can run Clippy by invoking `cargo clippy`.
#### Step 3: Run Clippy

If it says that it can't find the `clippy` subcommand, please run `rustup self update`
Now you can run Clippy by invoking the following command:

```terminal
cargo clippy
```

### Running Clippy from the command line without installing it

Expand Down Expand Up @@ -157,7 +162,7 @@ If you want to contribute to Clippy, you can find more information in [CONTRIBUT

## License

Copyright 2014-2018 The Rust Project Developers
Copyright 2014-2019 The Rust Project Developers

Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
Expand Down
9 changes: 0 additions & 9 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn main() {
// Forward the profile to the main compilation
println!("cargo:rustc-env=PROFILE={}", std::env::var("PROFILE").unwrap());
Expand Down
11 changes: 0 additions & 11 deletions ci/base-tests.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
# Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.


set -ex

echo "Running clippy base tests"
Expand Down
10 changes: 0 additions & 10 deletions ci/integration-tests.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
# Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.

set -x
rm ~/.cargo/bin/cargo-clippy
cargo install --force --path .
Expand Down
9 changes: 0 additions & 9 deletions clippy_dev/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![allow(clippy::default_hash_types)]

use itertools::Itertools;
Expand Down
9 changes: 0 additions & 9 deletions clippy_dev/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

extern crate clap;
extern crate clippy_dev;
extern crate regex;
Expand Down
12 changes: 1 addition & 11 deletions clippy_dummy/build.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.


extern crate term;

fn main() {
Expand Down Expand Up @@ -49,4 +39,4 @@ fn foo() -> Result<(), ()> {

t.reset().map_err(|_| ())?;
Ok(())
}
}
10 changes: 0 additions & 10 deletions clippy_dummy/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.


fn main() {
panic!("This shouldn't even compile")
}
9 changes: 0 additions & 9 deletions clippy_lints/src/approx_const.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use crate::utils::span_lint;
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
Expand Down
9 changes: 0 additions & 9 deletions clippy_lints/src/arithmetic.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use crate::utils::span_lint;
use rustc::hir;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
Expand Down
9 changes: 0 additions & 9 deletions clippy_lints/src/assign_ops.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use crate::utils::{get_trait_def_id, implements_trait, snippet_opt, span_lint_and_then, SpanlessEq};
use crate::utils::{higher, sugg};
use if_chain::if_chain;
Expand Down
18 changes: 4 additions & 14 deletions clippy_lints/src/attrs.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! checks for attributes
use crate::reexport::*;
Expand Down Expand Up @@ -520,18 +511,17 @@ impl EarlyLintPass for CfgAttrPass {
// check for `rustfmt_skip` and `rustfmt::skip`
if let Some(skip_item) = &items[1].meta_item();
if skip_item.name() == "rustfmt_skip" || skip_item.name() == "skip";
// Only lint outer attributes, because custom inner attributes are unstable
// Tracking issue: https://github.com/rust-lang/rust/issues/54726
if let AttrStyle::Outer = attr.style;
then {
let attr_style = match attr.style {
AttrStyle::Outer => "#[",
AttrStyle::Inner => "#![",
};
span_lint_and_sugg(
cx,
DEPRECATED_CFG_ATTR,
attr.span,
"`cfg_attr` is deprecated for rustfmt and got replaced by tool_attributes",
"use",
format!("{}rustfmt::skip]", attr_style),
"#[rustfmt::skip]".to_string(),
Applicability::MachineApplicable,
);
}
Expand Down
9 changes: 0 additions & 9 deletions clippy_lints/src/bit_mask.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use crate::consts::{constant, Constant};
use crate::utils::sugg::Sugg;
use crate::utils::{span_lint, span_lint_and_then};
Expand Down
9 changes: 0 additions & 9 deletions clippy_lints/src/blacklisted_name.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use crate::utils::span_lint;
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
Expand Down
9 changes: 0 additions & 9 deletions clippy_lints/src/block_in_if_condition.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use crate::utils::*;
use matches::matches;
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
Expand Down
9 changes: 0 additions & 9 deletions clippy_lints/src/booleans.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use crate::utils::{
get_trait_def_id, implements_trait, in_macro, match_type, paths, snippet_opt, span_lint_and_then, SpanlessEq,
};
Expand Down
9 changes: 0 additions & 9 deletions clippy_lints/src/bytecount.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use crate::utils::{
contains_name, get_pat_name, match_type, paths, single_segment_path, snippet_with_applicability,
span_lint_and_sugg, walk_ptrs_ty,
Expand Down
9 changes: 0 additions & 9 deletions clippy_lints/src/cargo_common_metadata.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! lint on missing cargo common metadata
use crate::utils::span_lint;
Expand Down
9 changes: 0 additions & 9 deletions clippy_lints/src/collapsible_if.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Checks for if expressions that contain only an if expression.
//!
//! For example, the lint would catch:
Expand Down
9 changes: 0 additions & 9 deletions clippy_lints/src/const_static_lifetime.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use crate::utils::{in_macro, snippet, span_lint_and_then};
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::{declare_tool_lint, lint_array};
Expand Down
10 changes: 0 additions & 10 deletions clippy_lints/src/consts.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.


#![allow(clippy::float_cmp)]

use crate::utils::{clip, sext, unsext};
Expand Down
9 changes: 0 additions & 9 deletions clippy_lints/src/copies.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use crate::utils::{get_parent_expr, in_macro, snippet, span_lint_and_then, span_note_and_lint};
use crate::utils::{SpanlessEq, SpanlessHash};
use rustc::hir::*;
Expand Down
9 changes: 0 additions & 9 deletions clippy_lints/src/copy_iterator.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use crate::utils::{is_copy, match_path, paths, span_note_and_lint};
use rustc::hir::{Item, ItemKind};
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
Expand Down
Loading

0 comments on commit eba7337

Please sign in to comment.