Skip to content

Commit cb7915b

Browse files
committed
Auto merge of #7733 - flip1995:rustup, r=flip1995
Rustup This needs a review this time. Especially rust-lang/rust-clippy@521bf8f cc `@camsteffen` I think this is necessary now, because `itertools` is no longer a dependency of `clippy_utils` and therefore this path can't be found 🤔 ( I forgot about the sync last week. I should get to document this process better, so other people can do it when I'm not around ) changelog: none
2 parents 08cead3 + c2b8882 commit cb7915b

38 files changed

+127
-169
lines changed

Cargo.toml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,35 @@ name = "clippy-driver"
2121
path = "src/driver.rs"
2222

2323
[dependencies]
24-
# begin automatic update
25-
clippy_lints = { version = "0.1.50", path = "clippy_lints" }
26-
# end automatic update
24+
clippy_lints = { version = "0.1", path = "clippy_lints" }
2725
semver = "0.11"
28-
rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util" }
29-
tempfile = { version = "3.1.0", optional = true }
26+
rustc_tools_util = { version = "0.2", path = "rustc_tools_util" }
27+
tempfile = { version = "3.2", optional = true }
3028

3129
[dev-dependencies]
3230
cargo_metadata = "0.12"
33-
compiletest_rs = { version = "0.6.0", features = ["tmp"] }
31+
compiletest_rs = { version = "0.7", features = ["tmp"] }
3432
tester = "0.9"
35-
regex = "1.4"
33+
regex = "1.5"
3634
# This is used by the `collect-metadata` alias.
3735
filetime = "0.2"
3836

3937
# A noop dependency that changes in the Rust repository, it's a bit of a hack.
4038
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
4139
# for more information.
42-
rustc-workspace-hack = "1.0.0"
40+
rustc-workspace-hack = "1.0"
4341

4442
# UI test dependencies
4543
clippy_utils = { path = "clippy_utils" }
4644
derive-new = "0.5"
4745
if_chain = "1.0"
48-
itertools = "0.10.1"
49-
quote = "1"
46+
itertools = "0.10"
47+
quote = "1.0"
5048
serde = { version = "1.0", features = ["derive"] }
51-
syn = { version = "1", features = ["full"] }
49+
syn = { version = "1.0", features = ["full"] }
5250

5351
[build-dependencies]
54-
rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util" }
52+
rustc_tools_util = { version = "0.2", path = "rustc_tools_util" }
5553

5654
[features]
5755
deny-warnings = ["clippy_lints/deny-warnings"]

clippy_dev/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ edition = "2021"
66
[dependencies]
77
bytecount = "0.6"
88
clap = "2.33"
9-
itertools = "0.9"
9+
itertools = "0.10"
1010
opener = "0.5"
11-
regex = "1"
11+
regex = "1.5"
1212
shell-escape = "0.1"
13-
walkdir = "2"
13+
walkdir = "2.3"
1414

1515
[features]
1616
deny-warnings = []

clippy_dummy/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ keywords = ["clippy", "lint", "plugin"]
1313
categories = ["development-tools", "development-tools::cargo-plugins"]
1414

1515
[build-dependencies]
16-
term = "0.6"
16+
term = "0.7"

clippy_lints/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ edition = "2021"
1111
[dependencies]
1212
cargo_metadata = "0.12"
1313
clippy_utils = { path = "../clippy_utils" }
14-
if_chain = "1.0.0"
15-
itertools = "0.9"
14+
if_chain = "1.0"
15+
itertools = "0.10"
1616
pulldown-cmark = { version = "0.8", default-features = false }
17-
quine-mc_cluskey = "0.2.2"
17+
quine-mc_cluskey = "0.2"
1818
regex-syntax = "0.6"
1919
serde = { version = "1.0", features = ["derive"] }
2020
serde_json = { version = "1.0", optional = true }
21-
toml = "0.5.3"
21+
toml = "0.5"
2222
unicode-normalization = "0.1"
23-
unicode-script = { version = "0.5.3", default-features = false }
23+
unicode-script = { version = "0.5", default-features = false }
2424
semver = "0.11"
25-
rustc-semver = "1.1.0"
25+
rustc-semver = "1.1"
2626
# NOTE: cargo requires serde feat in its url dep
2727
# see <https://github.com/rust-lang/rust/pull/63587#issuecomment-522343864>
28-
url = { version = "2.1.0", features = ["serde"] }
28+
url = { version = "2.2", features = ["serde"] }
2929

3030
[features]
3131
deny-warnings = ["clippy_utils/deny-warnings"]

clippy_lints/src/attrs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,8 @@ fn check_empty_line_after_outer_attr(cx: &EarlyContext<'_>, item: &rustc_ast::It
527527
return;
528528
}
529529

530-
let begin_of_attr_to_item = Span::new(attr.span.lo(), item.span.lo(), item.span.ctxt());
531-
let end_of_attr_to_item = Span::new(attr.span.hi(), item.span.lo(), item.span.ctxt());
530+
let begin_of_attr_to_item = Span::new(attr.span.lo(), item.span.lo(), item.span.ctxt(), item.span.parent());
531+
let end_of_attr_to_item = Span::new(attr.span.hi(), item.span.lo(), item.span.ctxt(), item.span.parent());
532532

533533
if let Some(snippet) = snippet_opt(cx, end_of_attr_to_item) {
534534
let lines = snippet.split('\n').collect::<Vec<_>>();

clippy_lints/src/cargo_common_metadata.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! lint on missing cargo common metadata
22
3-
use std::path::PathBuf;
4-
53
use clippy_utils::{diagnostics::span_lint, is_lint_allowed};
64
use rustc_hir::{hir_id::CRATE_HIR_ID, Crate};
75
use rustc_lint::{LateContext, LateLintPass};
@@ -69,12 +67,8 @@ fn missing_warning(cx: &LateContext<'_>, package: &cargo_metadata::Package, fiel
6967
span_lint(cx, CARGO_COMMON_METADATA, DUMMY_SP, &message);
7068
}
7169

72-
fn is_empty_str(value: &Option<String>) -> bool {
73-
value.as_ref().map_or(true, String::is_empty)
74-
}
75-
76-
fn is_empty_path(value: &Option<PathBuf>) -> bool {
77-
value.as_ref().and_then(|x| x.to_str()).map_or(true, str::is_empty)
70+
fn is_empty_str<T: AsRef<std::ffi::OsStr>>(value: &Option<T>) -> bool {
71+
value.as_ref().map_or(true, |s| s.as_ref().is_empty())
7872
}
7973

8074
fn is_empty_vec(value: &[String]) -> bool {
@@ -98,15 +92,15 @@ impl LateLintPass<'_> for CargoCommonMetadata {
9892
missing_warning(cx, &package, "package.description");
9993
}
10094

101-
if is_empty_str(&package.license) && is_empty_path(&package.license_file) {
95+
if is_empty_str(&package.license) && is_empty_str(&package.license_file) {
10296
missing_warning(cx, &package, "either package.license or package.license_file");
10397
}
10498

10599
if is_empty_str(&package.repository) {
106100
missing_warning(cx, &package, "package.repository");
107101
}
108102

109-
if is_empty_path(&package.readme) {
103+
if is_empty_str(&package.readme) {
110104
missing_warning(cx, &package, "package.readme");
111105
}
112106

clippy_lints/src/cognitive_complexity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl CognitiveComplexity {
9595
});
9696

9797
if let Some((low, high)) = pos {
98-
Span::new(low, high, header_span.ctxt())
98+
Span::new(low, high, header_span.ctxt(), header_span.parent())
9999
} else {
100100
return;
101101
}

clippy_lints/src/copies.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ fn emit_branches_sharing_code_lint(
472472

473473
let mut span = moved_start.to(span_end);
474474
// Improve formatting if the inner block has indention (i.e. normal Rust formatting)
475-
let test_span = Span::new(span.lo() - BytePos(4), span.lo(), span.ctxt());
475+
let test_span = Span::new(span.lo() - BytePos(4), span.lo(), span.ctxt(), span.parent());
476476
if snippet_opt(cx, test_span)
477477
.map(|snip| snip == " ")
478478
.unwrap_or_default()

clippy_lints/src/doc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ fn check_text(cx: &LateContext<'_>, valid_idents: &FxHashSet<String>, text: &str
665665
span.lo() + BytePos::from_usize(offset),
666666
span.lo() + BytePos::from_usize(offset + word.len()),
667667
span.ctxt(),
668+
span.parent(),
668669
);
669670

670671
check_word(cx, word, span);

clippy_lints/src/escape.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,11 @@ impl<'tcx> LateLintPass<'tcx> for BoxedLocal {
9191
if trait_item.id.hir_id() == hir_id {
9292
// be sure we have `self` parameter in this function
9393
if let AssocItemKind::Fn { has_self: true } = trait_item.kind {
94-
trait_self_ty =
95-
Some(TraitRef::identity(cx.tcx, trait_item.id.def_id.to_def_id()).self_ty());
94+
trait_self_ty = Some(
95+
TraitRef::identity(cx.tcx, trait_item.id.def_id.to_def_id())
96+
.self_ty()
97+
.skip_binder(),
98+
);
9699
}
97100
}
98101
}

0 commit comments

Comments
 (0)