Auto merge of #6536 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
This commit is contained in:
commit
1fcc74cc9e
8 changed files with 28 additions and 16 deletions
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "clippy"
|
name = "clippy"
|
||||||
version = "0.1.50"
|
version = "0.1.51"
|
||||||
authors = [
|
authors = [
|
||||||
"Manish Goregaokar <manishsmail@gmail.com>",
|
"Manish Goregaokar <manishsmail@gmail.com>",
|
||||||
"Andre Bogus <bogusandre@gmail.com>",
|
"Andre Bogus <bogusandre@gmail.com>",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "clippy_lints"
|
name = "clippy_lints"
|
||||||
# begin automatic update
|
# begin automatic update
|
||||||
version = "0.1.50"
|
version = "0.1.51"
|
||||||
# end automatic update
|
# end automatic update
|
||||||
authors = [
|
authors = [
|
||||||
"Manish Goregaokar <manishsmail@gmail.com>",
|
"Manish Goregaokar <manishsmail@gmail.com>",
|
||||||
|
|
|
@ -501,7 +501,7 @@ impl<'tcx> Visitor<'tcx> for BodyLifetimeChecker {
|
||||||
|
|
||||||
// for lifetimes as parameters of generics
|
// for lifetimes as parameters of generics
|
||||||
fn visit_lifetime(&mut self, lifetime: &'tcx Lifetime) {
|
fn visit_lifetime(&mut self, lifetime: &'tcx Lifetime) {
|
||||||
if lifetime.name.ident().name != kw::Invalid && lifetime.name.ident().name != kw::StaticLifetime {
|
if lifetime.name.ident().name != kw::Empty && lifetime.name.ident().name != kw::StaticLifetime {
|
||||||
self.lifetimes_used_in_body = true;
|
self.lifetimes_used_in_body = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -407,6 +407,10 @@ pub fn eq_use_tree_kind(l: &UseTreeKind, r: &UseTreeKind) -> bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn eq_anon_const(l: &AnonConst, r: &AnonConst) -> bool {
|
||||||
|
eq_expr(&l.value, &r.value)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn eq_defaultness(l: Defaultness, r: Defaultness) -> bool {
|
pub fn eq_defaultness(l: Defaultness, r: Defaultness) -> bool {
|
||||||
matches!(
|
matches!(
|
||||||
(l, r),
|
(l, r),
|
||||||
|
@ -497,7 +501,18 @@ pub fn eq_generic_param(l: &GenericParam, r: &GenericParam) -> bool {
|
||||||
&& match (&l.kind, &r.kind) {
|
&& match (&l.kind, &r.kind) {
|
||||||
(Lifetime, Lifetime) => true,
|
(Lifetime, Lifetime) => true,
|
||||||
(Type { default: l }, Type { default: r }) => both(l, r, |l, r| eq_ty(l, r)),
|
(Type { default: l }, Type { default: r }) => both(l, r, |l, r| eq_ty(l, r)),
|
||||||
(Const { ty: l, kw_span: _ }, Const { ty: r, kw_span: _ }) => eq_ty(l, r),
|
(
|
||||||
|
Const {
|
||||||
|
ty: lt,
|
||||||
|
kw_span: _,
|
||||||
|
default: ld,
|
||||||
|
},
|
||||||
|
Const {
|
||||||
|
ty: rt,
|
||||||
|
kw_span: _,
|
||||||
|
default: rd,
|
||||||
|
},
|
||||||
|
) => eq_ty(lt, rt) && both(ld, rd, |ld, rd| eq_anon_const(ld, rd)),
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
&& over(&l.attrs, &r.attrs, |l, r| eq_attr(l, r))
|
&& over(&l.attrs, &r.attrs, |l, r| eq_attr(l, r))
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "nightly-2020-12-20"
|
channel = "nightly-2021-01-02"
|
||||||
components = ["llvm-tools-preview", "rustc-dev", "rust-src", "rustfmt"]
|
components = ["llvm-tools-preview", "rustc-dev", "rust-src", "rustfmt"]
|
||||||
|
|
|
@ -39,7 +39,7 @@ fn main() {
|
||||||
B(i32),
|
B(i32),
|
||||||
C,
|
C,
|
||||||
D,
|
D,
|
||||||
};
|
}
|
||||||
let x = E::A(2);
|
let x = E::A(2);
|
||||||
{
|
{
|
||||||
// lint
|
// lint
|
||||||
|
|
|
@ -51,7 +51,7 @@ fn main() {
|
||||||
B(i32),
|
B(i32),
|
||||||
C,
|
C,
|
||||||
D,
|
D,
|
||||||
};
|
}
|
||||||
let x = E::A(2);
|
let x = E::A(2);
|
||||||
{
|
{
|
||||||
// lint
|
// lint
|
||||||
|
|
|
@ -28,17 +28,17 @@ fn check_that_clippy_has_the_same_major_version_as_rustc() {
|
||||||
let clippy_minor = clippy_version.minor;
|
let clippy_minor = clippy_version.minor;
|
||||||
let clippy_patch = clippy_version.patch;
|
let clippy_patch = clippy_version.patch;
|
||||||
|
|
||||||
// get the rustc version from cargo
|
// get the rustc version
|
||||||
// this way the rust-toolchain file version is honored
|
// this way the rust-toolchain file version is honored
|
||||||
let rustc_version = String::from_utf8(
|
let rustc_version = String::from_utf8(
|
||||||
std::process::Command::new("cargo")
|
std::process::Command::new("rustc")
|
||||||
.arg("--version")
|
.arg("--version")
|
||||||
.output()
|
.output()
|
||||||
.expect("failed to run 'cargo --version'")
|
.expect("failed to run `rustc --version`")
|
||||||
.stdout,
|
.stdout,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
// extract "1 50 0" from "cargo 1.50.0-nightly (a3c2627fb 2020-12-14)"
|
// extract "1 XX 0" from "rustc 1.XX.0-nightly (<commit> <date>)"
|
||||||
let vsplit: Vec<&str> = rustc_version
|
let vsplit: Vec<&str> = rustc_version
|
||||||
.split(' ')
|
.split(' ')
|
||||||
.nth(1)
|
.nth(1)
|
||||||
|
@ -50,9 +50,7 @@ fn check_that_clippy_has_the_same_major_version_as_rustc() {
|
||||||
.collect();
|
.collect();
|
||||||
match vsplit.as_slice() {
|
match vsplit.as_slice() {
|
||||||
[rustc_major, rustc_minor, _rustc_patch] => {
|
[rustc_major, rustc_minor, _rustc_patch] => {
|
||||||
// clippy 0.1.50 should correspond to rustc 1.50.0
|
// clippy 0.1.XX should correspond to rustc 1.XX.0
|
||||||
dbg!(&rustc_version);
|
|
||||||
dbg!(&clippy_version);
|
|
||||||
assert_eq!(clippy_major, 0); // this will probably stay the same for a long time
|
assert_eq!(clippy_major, 0); // this will probably stay the same for a long time
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
clippy_minor.to_string(),
|
clippy_minor.to_string(),
|
||||||
|
@ -68,8 +66,7 @@ fn check_that_clippy_has_the_same_major_version_as_rustc() {
|
||||||
// we don't want our tests failing suddenly
|
// we don't want our tests failing suddenly
|
||||||
},
|
},
|
||||||
_ => {
|
_ => {
|
||||||
dbg!(vsplit);
|
panic!("Failed to parse rustc version: {:?}", vsplit);
|
||||||
panic!("Failed to parse rustc version");
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue