Skip to content

Commit

Permalink
fix: cfg nighyly for integration test for cargo-dist to work on stable
Browse files Browse the repository at this point in the history
  • Loading branch information
zjp-CN committed Mar 16, 2024
1 parent 4a77b62 commit 3ab02af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/integration/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
let output = std::process::Command::new("rustc").arg("-V").output()?;
// set nightly cfg if current toolchain is nightly
if std::str::from_utf8(&output.stdout)?.contains("nightly") {
println!("cargo:rustc-cfg=nightly");
}
Ok(())
}
4 changes: 3 additions & 1 deletion tests/integration/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(c_variadic)]
#![cfg_attr(nightly, feature(c_variadic))]
/// Documentation for struct AUnitStruct.
pub struct AUnitStruct;

Expand Down Expand Up @@ -108,8 +108,10 @@ where
{
}
/// # Safety
#[cfg(nightly)]
pub unsafe extern "C" fn variadic(_: *const (), _name: ...) {}
/// # Safety
#[cfg(nightly)]
pub unsafe extern "C" fn variadic_multiline(_: *const (), _: *mut (), _name: ...) {}

pub trait ATraitWithGAT {
Expand Down

0 comments on commit 3ab02af

Please sign in to comment.