Skip to content

Commit a381bff

Browse files
authored
Merge pull request #340 from dtolnay/up
Delete no_track_caller configuration
2 parents 1a61a1e + c41ab5a commit a381bff

File tree

4 files changed

+13
-20
lines changed

4 files changed

+13
-20
lines changed

build.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,10 @@ fn main() {
1212

1313
if compiler >= 80 {
1414
println!("cargo:rustc-check-cfg=cfg(no_nonzero_bitscan)");
15-
println!("cargo:rustc-check-cfg=cfg(no_track_caller)");
1615
println!("cargo:rustc-check-cfg=cfg(no_unsafe_op_in_unsafe_fn_lint)");
1716
println!("cargo:rustc-check-cfg=cfg(test_node_semver)");
1817
}
1918

20-
if compiler < 46 {
21-
// #[track_caller].
22-
// https://blog.rust-lang.org/2020/08/27/Rust-1.46.0.html#track_caller
23-
println!("cargo:rustc-cfg=no_track_caller");
24-
}
25-
2619
if compiler < 52 {
2720
// #![deny(unsafe_op_in_unsafe_fn)].
2821
// https://github.com/rust-lang/rust/issues/71668

tests/node/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl Display for VersionReq {
3737
}
3838
}
3939

40-
#[cfg_attr(not(no_track_caller), track_caller)]
40+
#[track_caller]
4141
pub(super) fn req(text: &str) -> VersionReq {
4242
VersionReq(crate::util::req(text))
4343
}

tests/test_version_req.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ use node::{req, VersionReq};
1818
#[cfg(not(test_node_semver))]
1919
use semver::VersionReq;
2020

21-
#[cfg_attr(not(no_track_caller), track_caller)]
21+
#[track_caller]
2222
fn assert_match_all(req: &VersionReq, versions: &[&str]) {
2323
for string in versions {
2424
let parsed = version(string);
2525
assert!(req.matches(&parsed), "did not match {}", string);
2626
}
2727
}
2828

29-
#[cfg_attr(not(no_track_caller), track_caller)]
29+
#[track_caller]
3030
fn assert_match_none(req: &VersionReq, versions: &[&str]) {
3131
for string in versions {
3232
let parsed = version(string);

tests/util/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,52 @@
33
use semver::{BuildMetadata, Comparator, Error, Prerelease, Version, VersionReq};
44
use std::fmt::Display;
55

6-
#[cfg_attr(not(no_track_caller), track_caller)]
6+
#[track_caller]
77
pub(super) fn version(text: &str) -> Version {
88
Version::parse(text).unwrap()
99
}
1010

11-
#[cfg_attr(not(no_track_caller), track_caller)]
11+
#[track_caller]
1212
pub(super) fn version_err(text: &str) -> Error {
1313
Version::parse(text).unwrap_err()
1414
}
1515

16-
#[cfg_attr(not(no_track_caller), track_caller)]
16+
#[track_caller]
1717
pub(super) fn req(text: &str) -> VersionReq {
1818
VersionReq::parse(text).unwrap()
1919
}
2020

21-
#[cfg_attr(not(no_track_caller), track_caller)]
21+
#[track_caller]
2222
pub(super) fn req_err(text: &str) -> Error {
2323
VersionReq::parse(text).unwrap_err()
2424
}
2525

26-
#[cfg_attr(not(no_track_caller), track_caller)]
26+
#[track_caller]
2727
pub(super) fn comparator(text: &str) -> Comparator {
2828
Comparator::parse(text).unwrap()
2929
}
3030

31-
#[cfg_attr(not(no_track_caller), track_caller)]
31+
#[track_caller]
3232
pub(super) fn comparator_err(text: &str) -> Error {
3333
Comparator::parse(text).unwrap_err()
3434
}
3535

36-
#[cfg_attr(not(no_track_caller), track_caller)]
36+
#[track_caller]
3737
pub(super) fn prerelease(text: &str) -> Prerelease {
3838
Prerelease::new(text).unwrap()
3939
}
4040

41-
#[cfg_attr(not(no_track_caller), track_caller)]
41+
#[track_caller]
4242
pub(super) fn prerelease_err(text: &str) -> Error {
4343
Prerelease::new(text).unwrap_err()
4444
}
4545

46-
#[cfg_attr(not(no_track_caller), track_caller)]
46+
#[track_caller]
4747
pub(super) fn build_metadata(text: &str) -> BuildMetadata {
4848
BuildMetadata::new(text).unwrap()
4949
}
5050

51-
#[cfg_attr(not(no_track_caller), track_caller)]
51+
#[track_caller]
5252
pub(super) fn assert_to_string(value: impl Display, expected: &str) {
5353
assert_eq!(value.to_string(), expected);
5454
}

0 commit comments

Comments
 (0)