Skip to content

Commit 1fcc74c

Browse files
committed
Auto merge of #6536 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
2 parents b196528 + e4fbc5f commit 1fcc74c

File tree

8 files changed

+28
-16
lines changed

8 files changed

+28
-16
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.50"
3+
version = "0.1.51"
44
authors = [
55
"Manish Goregaokar <manishsmail@gmail.com>",
66
"Andre Bogus <bogusandre@gmail.com>",

clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_lints"
33
# begin automatic update
4-
version = "0.1.50"
4+
version = "0.1.51"
55
# end automatic update
66
authors = [
77
"Manish Goregaokar <manishsmail@gmail.com>",

clippy_lints/src/lifetimes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ impl<'tcx> Visitor<'tcx> for BodyLifetimeChecker {
501501

502502
// for lifetimes as parameters of generics
503503
fn visit_lifetime(&mut self, lifetime: &'tcx Lifetime) {
504-
if lifetime.name.ident().name != kw::Invalid && lifetime.name.ident().name != kw::StaticLifetime {
504+
if lifetime.name.ident().name != kw::Empty && lifetime.name.ident().name != kw::StaticLifetime {
505505
self.lifetimes_used_in_body = true;
506506
}
507507
}

clippy_lints/src/utils/ast_utils.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,10 @@ pub fn eq_use_tree_kind(l: &UseTreeKind, r: &UseTreeKind) -> bool {
407407
}
408408
}
409409

410+
pub fn eq_anon_const(l: &AnonConst, r: &AnonConst) -> bool {
411+
eq_expr(&l.value, &r.value)
412+
}
413+
410414
pub fn eq_defaultness(l: Defaultness, r: Defaultness) -> bool {
411415
matches!(
412416
(l, r),
@@ -497,7 +501,18 @@ pub fn eq_generic_param(l: &GenericParam, r: &GenericParam) -> bool {
497501
&& match (&l.kind, &r.kind) {
498502
(Lifetime, Lifetime) => true,
499503
(Type { default: l }, Type { default: r }) => both(l, r, |l, r| eq_ty(l, r)),
500-
(Const { ty: l, kw_span: _ }, Const { ty: r, kw_span: _ }) => eq_ty(l, r),
504+
(
505+
Const {
506+
ty: lt,
507+
kw_span: _,
508+
default: ld,
509+
},
510+
Const {
511+
ty: rt,
512+
kw_span: _,
513+
default: rd,
514+
},
515+
) => eq_ty(lt, rt) && both(ld, rd, |ld, rd| eq_anon_const(ld, rd)),
501516
_ => false,
502517
}
503518
&& over(&l.attrs, &r.attrs, |l, r| eq_attr(l, r))

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2020-12-20"
2+
channel = "nightly-2021-01-02"
33
components = ["llvm-tools-preview", "rustc-dev", "rust-src", "rustfmt"]

tests/ui/match_expr_like_matches_macro.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fn main() {
3939
B(i32),
4040
C,
4141
D,
42-
};
42+
}
4343
let x = E::A(2);
4444
{
4545
// lint

tests/ui/match_expr_like_matches_macro.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn main() {
5151
B(i32),
5252
C,
5353
D,
54-
};
54+
}
5555
let x = E::A(2);
5656
{
5757
// lint

tests/versioncheck.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ fn check_that_clippy_has_the_same_major_version_as_rustc() {
2828
let clippy_minor = clippy_version.minor;
2929
let clippy_patch = clippy_version.patch;
3030

31-
// get the rustc version from cargo
31+
// get the rustc version
3232
// this way the rust-toolchain file version is honored
3333
let rustc_version = String::from_utf8(
34-
std::process::Command::new("cargo")
34+
std::process::Command::new("rustc")
3535
.arg("--version")
3636
.output()
37-
.expect("failed to run 'cargo --version'")
37+
.expect("failed to run `rustc --version`")
3838
.stdout,
3939
)
4040
.unwrap();
41-
// extract "1 50 0" from "cargo 1.50.0-nightly (a3c2627fb 2020-12-14)"
41+
// extract "1 XX 0" from "rustc 1.XX.0-nightly (<commit> <date>)"
4242
let vsplit: Vec<&str> = rustc_version
4343
.split(' ')
4444
.nth(1)
@@ -50,9 +50,7 @@ fn check_that_clippy_has_the_same_major_version_as_rustc() {
5050
.collect();
5151
match vsplit.as_slice() {
5252
[rustc_major, rustc_minor, _rustc_patch] => {
53-
// clippy 0.1.50 should correspond to rustc 1.50.0
54-
dbg!(&rustc_version);
55-
dbg!(&clippy_version);
53+
// clippy 0.1.XX should correspond to rustc 1.XX.0
5654
assert_eq!(clippy_major, 0); // this will probably stay the same for a long time
5755
assert_eq!(
5856
clippy_minor.to_string(),
@@ -68,8 +66,7 @@ fn check_that_clippy_has_the_same_major_version_as_rustc() {
6866
// we don't want our tests failing suddenly
6967
},
7068
_ => {
71-
dbg!(vsplit);
72-
panic!("Failed to parse rustc version");
69+
panic!("Failed to parse rustc version: {:?}", vsplit);
7370
},
7471
};
7572
}

0 commit comments

Comments
 (0)