Skip to content

Commit bb2f6a5

Browse files
authored
Merge pull request #2821 from mati865/rust-2018-migration
Rust 2018 migration
2 parents b799c1e + cc8c52c commit bb2f6a5

File tree

117 files changed

+192
-184
lines changed

Some content is hidden

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

117 files changed

+192
-184
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
cargo-features = ["edition"]
2+
13
[package]
24
name = "clippy"
35
version = "0.0.206"
@@ -15,6 +17,7 @@ license = "MPL-2.0"
1517
keywords = ["clippy", "lint", "plugin"]
1618
categories = ["development-tools", "development-tools::cargo-plugins"]
1719
build = "build.rs"
20+
edition = "2018"
1821

1922
[badges]
2023
travis-ci = { repository = "rust-lang-nursery/rust-clippy" }

ci/integration-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set -x
2-
cargo install --force
2+
cargo install --force --path .
33

44
echo "Running integration test for crate ${INTEGRATION}"
55

clippy_lints/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
cargo-features = ["edition"]
2+
13
[package]
24
name = "clippy_lints"
35
# begin automatic update
@@ -14,6 +16,7 @@ repository = "https://github.com/rust-lang-nursery/rust-clippy"
1416
readme = "README.md"
1517
license = "MPL-2.0"
1618
keywords = ["clippy", "lint", "plugin"]
19+
edition = "2018"
1720

1821
[dependencies]
1922
cargo_metadata = "0.5"

clippy_lints/src/approx_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc::lint::*;
33
use std::f64::consts as f64;
44
use syntax::ast::{FloatTy, Lit, LitKind};
55
use syntax::symbol;
6-
use utils::span_lint;
6+
use crate::utils::span_lint;
77

88
/// **What it does:** Checks for floating point literals that approximate
99
/// constants which are defined in

clippy_lints/src/arithmetic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc::hir;
22
use rustc::lint::*;
33
use syntax::codemap::Span;
4-
use utils::span_lint;
4+
use crate::utils::span_lint;
55

66
/// **What it does:** Checks for plain integer arithmetic.
77
///

clippy_lints/src/array_indexing.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use consts::{constant, Constant};
1+
use crate::consts::{constant, Constant};
22
use rustc::hir;
33
use rustc::lint::*;
44
use rustc::ty;
55
use syntax::ast::RangeLimits;
6-
use utils::higher::Range;
7-
use utils::{self, higher};
6+
use crate::utils::higher::Range;
7+
use crate::utils::{self, higher};
88

99
/// **What it does:** Checks for out of bounds array indexing with a constant
1010
/// index.

clippy_lints/src/assign_ops.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use rustc::hir;
22
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
33
use rustc::lint::*;
44
use syntax::ast;
5-
use utils::{get_trait_def_id, implements_trait, snippet_opt, span_lint_and_then, SpanlessEq};
6-
use utils::{higher, sugg};
5+
use crate::utils::{get_trait_def_id, implements_trait, snippet_opt, span_lint_and_then, SpanlessEq};
6+
use crate::utils::{higher, sugg};
77

88
/// **What it does:** Checks for compound assignment operations (`+=` and
99
/// similar).
@@ -145,7 +145,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
145145
$($trait_name:ident:$full_trait_name:ident),+) => {
146146
match $op {
147147
$(hir::$full_trait_name => {
148-
let [krate, module] = ::utils::paths::OPS_MODULE;
148+
let [krate, module] = crate::utils::paths::OPS_MODULE;
149149
let path = [krate, module, concat!(stringify!($trait_name), "Assign")];
150150
let trait_id = if let Some(trait_id) = get_trait_def_id($cx, &path) {
151151
trait_id

clippy_lints/src/attrs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//! checks for attributes
22
3-
use reexport::*;
3+
use crate::reexport::*;
44
use rustc::hir::*;
55
use rustc::lint::*;
66
use rustc::ty::{self, TyCtxt};
77
use semver::Version;
88
use syntax::ast::{AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem, NestedMetaItemKind};
99
use syntax::codemap::Span;
10-
use utils::{
10+
use crate::utils::{
1111
in_macro, last_line_of_span, match_def_path, opt_def_id, paths, snippet_opt, span_lint, span_lint_and_then,
1212
without_block_comments,
1313
};

clippy_lints/src/bit_mask.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use rustc::hir::*;
22
use rustc::lint::*;
33
use syntax::ast::LitKind;
44
use syntax::codemap::Span;
5-
use utils::{span_lint, span_lint_and_then};
6-
use utils::sugg::Sugg;
7-
use consts::{constant, Constant};
5+
use crate::utils::{span_lint, span_lint_and_then};
6+
use crate::utils::sugg::Sugg;
7+
use crate::consts::{constant, Constant};
88

99
/// **What it does:** Checks for incompatible bit masks in comparisons.
1010
///

clippy_lints/src/blacklisted_name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use rustc::lint::*;
22
use rustc::hir::*;
3-
use utils::span_lint;
3+
use crate::utils::span_lint;
44

55
/// **What it does:** Checks for usage of blacklisted names for variables, such
66
/// as `foo`.

0 commit comments

Comments
 (0)