Skip to content

Commit 89cbd82

Browse files
committed
Remove track_caller feature detection because msrv was bumped
1 parent db36f6d commit 89cbd82

File tree

3 files changed

+2
-26
lines changed

3 files changed

+2
-26
lines changed

Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ generate-parsing-rs = ["peg"]
6666
testing-helpers = ["rustc_version"]
6767
is_variant = ["convert_case"]
6868
unwrap = ["convert_case", "rustc_version"]
69-
# Feature that requires post-MSRV Rust version,
70-
# of 1.46. We perform rustc version detection in the
71-
# build script for features that require this.
72-
# (Currently just `unwrap`.)
69+
# Unused, kept for backwards compatibility
7370
track-caller = []
7471

7572
default = [

build.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,7 @@ fn detect_nightly() {
3434
}
3535
}
3636

37-
#[cfg(not(feature = "unwrap"))]
38-
fn detect_track_caller() {}
39-
/// Detect availability of the `#[track_caller]` attribute for
40-
/// use in derived panicking methods like `.unwrap_*()`.
41-
#[cfg(feature = "unwrap")]
42-
fn detect_track_caller() {
43-
use rustc_version::version_meta;
44-
if version_meta().unwrap().semver.minor >= 46 {
45-
println!("cargo:rustc-cfg=feature=\"track-caller\"");
46-
}
47-
}
48-
4937
fn main() {
5038
detect_nightly();
51-
detect_track_caller();
5239
generate_peg();
5340
}

src/unwrap.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,8 @@ pub fn expand(input: &DeriveInput, trait_name: &'static str) -> Result<TokenStre
7171
}
7272
});
7373

74-
// The `track-caller` feature is set by our build script based
75-
// on rustc version detection, as `#[track_caller]` was
76-
// stabilized in a later version (1.46) of Rust than our MSRV (1.36).
77-
let track_caller = if cfg!(feature = "track-caller") {
78-
quote! { #[track_caller] }
79-
} else {
80-
quote! {}
81-
};
8274
let func = quote! {
83-
#track_caller
75+
#[track_caller]
8476
pub fn #fn_name(self) -> #ret_type {
8577
match self {
8678
#enum_name ::#variant_ident #data_pattern => #ret_value,

0 commit comments

Comments
 (0)