Skip to content

Commit

Permalink
🐛 remove naked function feature to fix nightly build (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xudong-Huang committed Sep 7, 2020
1 parent 188f42b commit 3293b89
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use rustc_version::{version_meta, Channel};
fn main() {
// Set cfg flags depending on release channel
if let Channel::Nightly = version_meta().unwrap().channel {
return println!("cargo:rustc-cfg=nightly");
// return println!("cargo:rustc-cfg=nightly");
println!("cargo:rustc-cfg=nightly");
}

// for the stable build asm lib
Expand Down
4 changes: 3 additions & 1 deletion src/detail/x86_64_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ use crate::detail::{align_down, mut_offset};
use crate::reg_context::InitFn;
use crate::stack::Stack;

#[cfg(not(nightly))]
// #[cfg(not(nightly))]
#[link(name = "asm", kind = "static")]
extern "C" {
pub fn bootstrap_green_task();
pub fn prefetch(data: *const usize);
pub fn swap_registers(out_regs: *mut Registers, in_regs: *const Registers);
}

/*
#[cfg(nightly)]
mod asm_impl {
use super::Registers;
Expand Down Expand Up @@ -88,6 +89,7 @@ mod asm_impl {
}
#[cfg(nightly)]
pub use self::asm_impl::*;
*/

#[repr(C)]
#[derive(Debug)]
Expand Down
8 changes: 5 additions & 3 deletions src/detail/x86_64_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::detail::{align_down, mut_offset};
use crate::reg_context::InitFn;
use crate::stack::Stack;

#[cfg(not(nightly))]
// #[cfg(not(nightly))]
#[link(name = "asm", kind = "static")]
extern "C" {
pub fn bootstrap_green_task();
Expand All @@ -16,6 +16,7 @@ pub fn prefetch(data: *const usize) {
unsafe { prefetch_asm(data) }
}

/*
#[cfg(nightly)]
mod asm_impl {
use super::Registers;
Expand Down Expand Up @@ -162,9 +163,10 @@ mod asm_impl {
}
#[cfg(nightly)]
pub use self::asm_impl::*;
*/

#[cfg_attr(nightly, repr(simd))]
#[cfg_attr(not(nightly), repr(C))]
// #[cfg_attr(nightly, repr(simd))]
#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
struct XMM(u32, u32, u32, u32);
Expand Down
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
//! Rust generator library
//!
#![cfg_attr(nightly, feature(llvm_asm))]
#![cfg_attr(nightly, feature(repr_simd))]
#![cfg_attr(nightly, feature(core_intrinsics))]
#![cfg_attr(nightly, feature(naked_functions))]
#![cfg_attr(nightly, feature(thread_local))]
#![cfg_attr(test, deny(warnings))]
#![deny(missing_docs)]
Expand Down

0 comments on commit 3293b89

Please sign in to comment.