From 655aef7c6c1469ab647185b570b1689bb9417815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Thu, 23 May 2019 17:23:59 +0200 Subject: [PATCH 1/3] update if_chain to 1.0.0 --- clippy_lints/Cargo.toml | 2 +- clippy_lints/src/consts.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/clippy_lints/Cargo.toml b/clippy_lints/Cargo.toml index 20b3a3e4937..42e92bc1c79 100644 --- a/clippy_lints/Cargo.toml +++ b/clippy_lints/Cargo.toml @@ -29,7 +29,7 @@ toml = "0.5" unicode-normalization = "0.1" pulldown-cmark = "0.5.0" url = "1.7.0" -if_chain = "0.1.3" +if_chain = "1.0.0" smallvec = { version = "0.6.5", features = ["union"] } [features] diff --git a/clippy_lints/src/consts.rs b/clippy_lints/src/consts.rs index cbc10768bbc..16f1f1cab19 100644 --- a/clippy_lints/src/consts.rs +++ b/clippy_lints/src/consts.rs @@ -251,7 +251,8 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> { if let ExprKind::Path(qpath) = &callee.node; let res = self.tables.qpath_res(qpath, callee.hir_id); if let Some(def_id) = res.opt_def_id(); - let def_path = self.lcx.get_def_path(def_id) + let get_def_path = self.lcx.get_def_path(def_id); + let def_path = get_def_path .iter() .map(LocalInternedString::get) .collect::>(); From c8443c1528939fc3955fed67c0422dee12306a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Thu, 23 May 2019 17:30:05 +0200 Subject: [PATCH 2/3] rustc_tool_utils: bump version to 0.2.0 --- rustc_tools_util/Cargo.toml | 2 +- rustc_tools_util/src/lib.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rustc_tools_util/Cargo.toml b/rustc_tools_util/Cargo.toml index 70ff86c49af..43e14ea174d 100644 --- a/rustc_tools_util/Cargo.toml +++ b/rustc_tools_util/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustc_tools_util" -version = "0.1.1" +version = "0.2.0" authors = ["Matthias Krüger "] description = "small helper to generate version information for git packages" repository = "https://github.com/rust-lang/rust-clippy" diff --git a/rustc_tools_util/src/lib.rs b/rustc_tools_util/src/lib.rs index 8f89d50c64a..ec3b69219e7 100644 --- a/rustc_tools_util/src/lib.rs +++ b/rustc_tools_util/src/lib.rs @@ -131,8 +131,8 @@ mod test { fn test_struct_local() { let vi = get_version_info!(); assert_eq!(vi.major, 0); - assert_eq!(vi.minor, 1); - assert_eq!(vi.patch, 1); + assert_eq!(vi.minor, 2); + assert_eq!(vi.patch, 0); assert_eq!(vi.crate_name, "rustc_tools_util"); // hard to make positive tests for these since they will always change assert!(vi.commit_hash.is_none()); @@ -142,7 +142,7 @@ mod test { #[test] fn test_display_local() { let vi = get_version_info!(); - assert_eq!(vi.to_string(), "rustc_tools_util 0.1.1"); + assert_eq!(vi.to_string(), "rustc_tools_util 0.2.0"); } #[test] @@ -151,7 +151,7 @@ mod test { let s = format!("{:?}", vi); assert_eq!( s, - "VersionInfo { crate_name: \"rustc_tools_util\", major: 0, minor: 1, patch: 1 }" + "VersionInfo { crate_name: \"rustc_tools_util\", major: 0, minor: 2, patch: 0 }" ); } From 68281ad0b2dfa042627e84463a5fe7f33b5a88b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Thu, 23 May 2019 17:40:54 +0200 Subject: [PATCH 3/3] clippy: bump rustc_tools util version to 0.2 rustc_tools_util: fix typo in docs (readme) --- Cargo.toml | 4 ++-- build.rs | 4 ++++ rustc_tools_util/README.md | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4c1b77c256c..3a3e225db58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ clippy_lints = { version = "0.0.212", path = "clippy_lints" } # end automatic update regex = "1" semver = "0.9" -rustc_tools_util = { version = "0.1.1", path = "rustc_tools_util"} +rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util"} [dev-dependencies] cargo_metadata = "0.7.1" @@ -58,7 +58,7 @@ derive-new = "0.5" rustc-workspace-hack = "1.0.0" [build-dependencies] -rustc_tools_util = { version = "0.1.1", path = "rustc_tools_util"} +rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util"} [features] debugging = [] diff --git a/build.rs b/build.rs index 146a8dae745..018375dbada 100644 --- a/build.rs +++ b/build.rs @@ -12,4 +12,8 @@ fn main() { "cargo:rustc-env=COMMIT_DATE={}", rustc_tools_util::get_commit_date().unwrap_or_default() ); + println!( + "cargo:rustc-env=RUSTC_RELEASE_CHANNEL={}", + rustc_tools_util::get_channel().unwrap_or_default() + ); } diff --git a/rustc_tools_util/README.md b/rustc_tools_util/README.md index 79c90b86b6c..18341ca2f28 100644 --- a/rustc_tools_util/README.md +++ b/rustc_tools_util/README.md @@ -32,7 +32,7 @@ fn main() { ); println!( "cargo:rustc-env=RUSTC_RELEASE_CHANNEL={}", - rustc_tools_util::get_channel_from_compiler_output().unwrap_or_default() + rustc_tools_util::get_channel().unwrap_or_default() ); }