Skip to content

Commit 004b885

Browse files
committed
rustc_tools_util: changelog and 0.3.0 release
1 parent aa66212 commit 004b885

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ path = "src/driver.rs"
2323
[dependencies]
2424
clippy_lints = { path = "clippy_lints" }
2525
semver = "1.0"
26-
rustc_tools_util = {version = "0.2.1", path = "./rustc_tools_util"}
26+
rustc_tools_util = "0.3.0"
2727
tempfile = { version = "3.2", optional = true }
2828
termize = "0.1"
2929

@@ -56,7 +56,7 @@ tokio = { version = "1", features = ["io-util"] }
5656
rustc-semver = "1.1"
5757

5858
[build-dependencies]
59-
rustc_tools_util = {version = "0.2.1", path = "./rustc_tools_util"}
59+
rustc_tools_util = "0.3.0"
6060

6161
[features]
6262
deny-warnings = ["clippy_lints/deny-warnings"]

rustc_tools_util/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
3+
## Version 0.3.0
4+
5+
* Added `setup_version_info!();` macro for automated scripts.
6+
* `get_version_info!()` no longer requires the user to import `rustc_tools_util::VersionInfo` and `std::env`

rustc_tools_util/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustc_tools_util"
3-
version = "0.2.1"
3+
version = "0.3.0"
44
description = "small helper to generate version information for git packages"
55
repository = "https://github.com/rust-lang/rust-clippy"
66
readme = "README.md"

rustc_tools_util/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ build = "build.rs"
1313
List rustc_tools_util as regular AND build dependency.
1414
````toml
1515
[dependencies]
16-
rustc_tools_util = "0.2.1"
16+
rustc_tools_util = "0.3.0"
1717

1818
[build-dependencies]
19-
rustc_tools_util = "0.2.1"
19+
rustc_tools_util = "0.3.0"
2020
````
2121

2222
In `build.rs`, generate the data in your `main()`
@@ -44,6 +44,9 @@ This gives the following output in clippy:
4444
This project is part of the rust-lang/rust-clippy repository. The source code
4545
can be found under `./rustc_tools_util/`.
4646

47+
The changelog for `rustc_tools_util` is available under:
48+
[`rustc_tools_util/CHANGELOG.md`](https://github.com/rust-lang/rust-clippy/blob/master/rustc_tools_util/CHANGELOG.md)
49+
4750
## License
4851

4952
Copyright 2014-2022 The Rust Project Developers

rustc_tools_util/src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
22

3-
use std::env;
4-
53
/// This macro creates the version string during compilation from the
64
/// current environment
75
#[macro_export]
@@ -121,7 +119,7 @@ pub fn get_commit_date() -> Option<String> {
121119

122120
#[must_use]
123121
pub fn get_channel() -> String {
124-
match env::var("CFG_RELEASE_CHANNEL") {
122+
match std::env::var("CFG_RELEASE_CHANNEL") {
125123
Ok(channel) => channel,
126124
Err(_) => {
127125
// if that failed, try to ask rustc -V, do some parsing and find out
@@ -156,8 +154,8 @@ mod test {
156154
fn test_struct_local() {
157155
let vi = get_version_info!();
158156
assert_eq!(vi.major, 0);
159-
assert_eq!(vi.minor, 2);
160-
assert_eq!(vi.patch, 1);
157+
assert_eq!(vi.minor, 3);
158+
assert_eq!(vi.patch, 0);
161159
assert_eq!(vi.crate_name, "rustc_tools_util");
162160
// hard to make positive tests for these since they will always change
163161
assert!(vi.commit_hash.is_none());
@@ -167,7 +165,7 @@ mod test {
167165
#[test]
168166
fn test_display_local() {
169167
let vi = get_version_info!();
170-
assert_eq!(vi.to_string(), "rustc_tools_util 0.2.1");
168+
assert_eq!(vi.to_string(), "rustc_tools_util 0.3.0");
171169
}
172170

173171
#[test]
@@ -176,7 +174,7 @@ mod test {
176174
let s = format!("{vi:?}");
177175
assert_eq!(
178176
s,
179-
"VersionInfo { crate_name: \"rustc_tools_util\", major: 0, minor: 2, patch: 1 }"
177+
"VersionInfo { crate_name: \"rustc_tools_util\", major: 0, minor: 3, patch: 0 }"
180178
);
181179
}
182180
}

0 commit comments

Comments
 (0)