Skip to content

Commit f91181e

Browse files
committed
rebase on #267
Created using spr 1.3.6-beta.1
2 parents 8bc9b0c + d70945f commit f91181e

File tree

27 files changed

+6
-185
lines changed

27 files changed

+6
-185
lines changed

common-build.rs

-27
This file was deleted.

probe-test-attr/src/main.rs

-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
// See the License for the specific language governing permissions and
1616
// limitations under the License.
1717

18-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
19-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
20-
2118
use serde::Serialize;
2219

2320
/// By deriving the `serde::Serialize` trait, the `Arg` struct can be used as an argument to a

probe-test-build/build.rs

-10
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ use usdt::Builder;
1717
fn main() {
1818
println!("cargo:rerun-if-changed=build.rs");
1919

20-
if !version_check::is_min_version("1.59").unwrap_or(false) {
21-
println!("cargo:rustc-cfg=usdt_need_feat_asm");
22-
}
23-
#[cfg(target_os = "macos")]
24-
if version_check::supports_feature("asm_sym").unwrap_or(false)
25-
&& !version_check::is_min_version("1.67").unwrap_or(false)
26-
{
27-
println!("cargo:rustc-cfg=usdt_need_feat_asm_sym");
28-
}
29-
3020
println!("cargo:rerun-if-changed=test.d");
3121
Builder::new("test.d").build().unwrap();
3222
}

probe-test-build/src/main.rs

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
// See the License for the specific language governing permissions and
1515
// limitations under the License.
1616

17-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
18-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
19-
2017
use std::thread::sleep;
2118
use std::time::Duration;
2219

probe-test-macro/src/main.rs

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
// See the License for the specific language governing permissions and
1515
// limitations under the License.
1616

17-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
18-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
19-
2017
use std::thread::sleep;
2118
use std::time::Duration;
2219

tests/argument-types/src/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
// See the License for the specific language governing permissions and
1616
// limitations under the License.
1717

18-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
19-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
2018
use serde::Serialize;
2119

2220
/// Most struct or tuple types implementing serde::Serialize may be used in probes.

tests/does-it-work/build.rs

-10
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ use usdt::Builder;
1717
fn main() {
1818
println!("cargo:rerun-if-changed=build.rs");
1919

20-
if !version_check::is_min_version("1.59").unwrap_or(false) {
21-
println!("cargo:rustc-cfg=usdt_need_feat_asm");
22-
}
23-
#[cfg(target_os = "macos")]
24-
if version_check::supports_feature("asm_sym").unwrap_or(false)
25-
&& !version_check::is_min_version("1.67").unwrap_or(false)
26-
{
27-
println!("cargo:rustc-cfg=usdt_need_feat_asm_sym");
28-
}
29-
3020
println!("cargo:rerun-if-changed=test.d");
3121
Builder::new("test.d").build().unwrap();
3222
}

tests/does-it-work/src/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
// See the License for the specific language governing permissions and
1717
// limitations under the License.
1818

19-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
20-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
2119
#![allow(non_snake_case)]
2220

2321
use usdt::register_probes;

tests/empty/build.rs

-10
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ use usdt::Builder;
1717
fn main() {
1818
println!("cargo:rerun-if-changed=build.rs");
1919

20-
if !version_check::is_min_version("1.59").unwrap_or(false) {
21-
println!("cargo:rustc-cfg=usdt_need_feat_asm");
22-
}
23-
#[cfg(target_os = "macos")]
24-
if version_check::supports_feature("asm_sym").unwrap_or(false)
25-
&& !version_check::is_min_version("1.67").unwrap_or(false)
26-
{
27-
println!("cargo:rustc-cfg=usdt_need_feat_asm_sym");
28-
}
29-
3020
println!("cargo:rerun-if-changed=provider.d");
3121
Builder::new("provider.d")
3222
.build()

tests/empty/src/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
16-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
1715
#![deny(warnings)]
1816

1917
use usdt::register_probes;

tests/fake-cmd/src/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
16-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
1715
#![deny(warnings)]
1816

1917
fn main() {

tests/fake-lib/build.rs

-10
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ use usdt::Builder;
1717
fn main() {
1818
println!("cargo:rerun-if-changed=build.rs");
1919

20-
if !version_check::is_min_version("1.59").unwrap_or(false) {
21-
println!("cargo:rustc-cfg=usdt_need_feat_asm");
22-
}
23-
#[cfg(target_os = "macos")]
24-
if version_check::supports_feature("asm_sym").unwrap_or(false)
25-
&& !version_check::is_min_version("1.67").unwrap_or(false)
26-
{
27-
println!("cargo:rustc-cfg=usdt_need_feat_asm_sym");
28-
}
29-
3020
println!("cargo:rerun-if-changed=test.d");
3121
Builder::new("test.d").build().unwrap();
3222
}

tests/fake-lib/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
16-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
1715
#![deny(warnings)]
1816

1917
pub use usdt::register_probes;

tests/modules/src/main.rs

-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
16-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
17-
1815
mod inner;
1916

2017
fn main() {

tests/rename-builder/build.rs

-10
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ use usdt::Builder;
1717
fn main() {
1818
println!("cargo:rerun-if-changed=build.rs");
1919

20-
if !version_check::is_min_version("1.59").unwrap_or(false) {
21-
println!("cargo:rustc-cfg=usdt_need_feat_asm");
22-
}
23-
#[cfg(target_os = "macos")]
24-
if version_check::supports_feature("asm_sym").unwrap_or(false)
25-
&& !version_check::is_min_version("1.67").unwrap_or(false)
26-
{
27-
println!("cargo:rustc-cfg=usdt_need_feat_asm_sym");
28-
}
29-
3020
println!("cargo:rerun-if-changed=test.d");
3121
Builder::new("test.d").module("still_test").build().unwrap();
3222
}

tests/rename-builder/src/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
// See the License for the specific language governing permissions and
1616
// limitations under the License.
1717

18-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
19-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
2018
include!(concat!(env!("OUT_DIR"), "/test.rs"));
2119

2220
fn main() {

tests/rename/src/main.rs

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
// See the License for the specific language governing permissions and
1515
// limitations under the License.
1616

17-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
18-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
19-
2017
#[usdt::provider(provider = "something", probe_format = "probe_{probe}")]
2118
mod probes {
2219
fn something() {}

tests/test-json/src/main.rs

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
// See the License for the specific language governing permissions and
1515
// limitations under the License.
1616

17-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
18-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
19-
2017
use serde::{Serialize, Serializer};
2118

2219
// Expected error message from serialization failure

tests/test-unique-id/src/main.rs

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
// See the License for the specific language governing permissions and
1515
// limitations under the License.
1616

17-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
18-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
19-
2017
#[usdt::provider]
2118
mod with_ids {
2219
use usdt::UniqueId;

tests/usize/src/main.rs

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
// See the License for the specific language governing permissions and
1515
// limitations under the License.
1616

17-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
18-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
19-
2017
#[usdt::provider]
2118
mod usize__test {
2219
fn emit_usize(_: usize) {}

tests/zero-arg-probe/build.rs

-10
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ use usdt::Builder;
1717
fn main() {
1818
println!("cargo:rerun-if-changed=build.rs");
1919

20-
if !version_check::is_min_version("1.59").unwrap_or(false) {
21-
println!("cargo:rustc-cfg=usdt_need_feat_asm");
22-
}
23-
#[cfg(target_os = "macos")]
24-
if version_check::supports_feature("asm_sym").unwrap_or(false)
25-
&& !version_check::is_min_version("1.67").unwrap_or(false)
26-
{
27-
println!("cargo:rustc-cfg=usdt_need_feat_asm_sym");
28-
}
29-
3020
println!("cargo:rerun-if-changed=test.d");
3121
Builder::new("test.d").build().unwrap();
3222
}

tests/zero-arg-probe/src/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
16-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
1715
#![deny(warnings)]
1816

1917
use usdt::register_probes;

usdt-impl/build.rs

+3-48
Original file line numberDiff line numberDiff line change
@@ -31,57 +31,12 @@ fn main() {
3131
println!("cargo::rustc-check-cfg=cfg(usdt_backend_linker)");
3232
println!("cargo::rustc-check-cfg=cfg(usdt_backend_standard)");
3333

34-
// `asm` feature was stabilized in 1.59
35-
let have_stable_asm = version_check::is_min_version("1.59").unwrap_or(false);
36-
// `asm_sym` feature was stabilized in 1.66
37-
let have_stable_asm_sym = version_check::is_min_version("1.66").unwrap_or(false);
38-
39-
// Are we being built with a compiler which allows feature flags (nightly)
40-
let is_nightly = version_check::is_feature_flaggable().unwrap_or(false);
41-
42-
let feat_asm = env::var_os("CARGO_FEATURE_ASM").is_some();
43-
let feat_strict_asm = env::var_os("CARGO_FEATURE_STRICT_ASM").is_some();
44-
4534
let backend = match env::var("CARGO_CFG_TARGET_OS").ok().as_deref() {
46-
Some("macos") if feat_asm => {
47-
if have_stable_asm && have_stable_asm_sym {
48-
Backend::Linker
49-
} else if feat_strict_asm || is_nightly {
50-
if !have_stable_asm {
51-
println!("cargo:rustc-cfg=usdt_need_feat_asm");
52-
}
53-
if !have_stable_asm_sym {
54-
println!("cargo:rustc-cfg=usdt_need_feat_asm_sym");
55-
}
56-
Backend::Linker
57-
} else {
58-
Backend::NoOp
59-
}
60-
}
61-
Some("illumos") | Some("solaris") if feat_asm => {
62-
if have_stable_asm {
63-
Backend::Standard
64-
} else if feat_strict_asm || is_nightly {
65-
println!("cargo:rustc-cfg=usdt_need_feat_asm");
66-
Backend::Standard
67-
} else {
68-
Backend::NoOp
69-
}
70-
}
71-
_ => {
72-
if !have_stable_asm {
73-
println!("cargo:rustc-cfg=usdt_need_feat_asm");
74-
}
75-
Backend::NoOp
76-
}
35+
Some("macos") => Backend::Linker,
36+
Some("illumos") | Some("solaris") => Backend::Standard,
37+
_ => Backend::NoOp,
7738
};
7839

79-
// Since visibility of the `asm!()` macro differs between the nightly feature and the
80-
// stabilized version, the consumer requires information about its availability
81-
if have_stable_asm {
82-
println!("cargo:rustc-cfg=usdt_stable_asm");
83-
}
84-
8540
match backend {
8641
Backend::NoOp => {
8742
println!("cargo:rustc-cfg=usdt_backend_noop");

usdt-impl/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
// See the License for the specific language governing permissions and
1515
// limitations under the License.
1616

17-
#![cfg_attr(usdt_need_feat_asm, feature(asm))]
18-
#![cfg_attr(usdt_need_feat_asm_sym, feature(asm_sym))]
19-
2017
use serde::Deserialize;
2118
use std::cell::RefCell;
2219
use thiserror::Error;

usdt-impl/src/linker.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,7 @@ fn compile_probe(
179179
#[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))]
180180
compile_error!("USDT only supports x86_64 and AArch64 architectures");
181181

182-
#[cfg(usdt_stable_asm)]
183-
let asm_macro = quote! { std::arch::asm };
184-
#[cfg(not(usdt_stable_asm))]
185-
let asm_macro = quote! { asm };
182+
let asm_macro = quote! { ::std::arch::asm };
186183

187184
let impl_block = quote! {
188185
extern "C" {

usdt-impl/src/no-linker.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@ fn compile_probe(
8282
let (unpacked_args, in_regs) = common::construct_probe_args(&probe.types);
8383
let is_enabled_rec = emit_probe_record(&provider.name, &probe.name, None);
8484
let probe_rec = emit_probe_record(&provider.name, &probe.name, Some(&probe.types));
85-
#[cfg(usdt_stable_asm)]
86-
let asm_macro = quote! { std::arch::asm };
87-
#[cfg(not(usdt_stable_asm))]
88-
let asm_macro = quote! { asm };
85+
let asm_macro = quote! { ::std::arch::asm };
8986

9087
let impl_block = quote! {
9188
{

usdt/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55
license = "Apache-2.0"
66
description = "Dust your Rust with USDT probes"
77
repository = "https://github.com/oxidecomputer/usdt.git"
8-
rust-version = "1.63.0"
8+
rust-version = "1.75.0"
99

1010
# NOTE: The use of path and version dependencies is deliberate and load-bearing.
1111
#

0 commit comments

Comments
 (0)