Skip to content

Commit

Permalink
Assume we're always on Rust 1.30+
Browse files Browse the repository at this point in the history
  • Loading branch information
koute committed Dec 8, 2018
1 parent cb95888 commit f03c35b
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 28 deletions.
6 changes: 1 addition & 5 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
extern crate rustc_version;
use rustc_version::{version, version_meta, Version, Channel};
use rustc_version::{version, version_meta, Channel};

fn main() {
let mut current = version().unwrap();
current.pre = Vec::new();

if current >= Version::parse( "1.30.0" ).unwrap() {
println!( "cargo:rustc-cfg=rust_1_30_or_newer" );
}

if version_meta().unwrap().channel == Channel::Nightly {
println!( "cargo:rustc-cfg=rust_nightly" );
}
Expand Down
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
unused_qualifications
)]
#![cfg_attr(
all(test, rust_1_30_or_newer, rust_nightly),
all(test, rust_nightly),
feature(linkage) // Needed for async tests.
)]
#![cfg_attr(rust_nightly, feature(core_intrinsics))]
Expand All @@ -130,17 +130,14 @@ extern crate serde_json;
#[macro_use]
extern crate serde_derive;

#[cfg(rust_1_30_or_newer)]
extern crate stdweb_internal_macros;

#[cfg(all(
rust_1_30_or_newer,
target_arch = "wasm32",
target_os = "unknown"
))]
pub use stdweb_internal_macros::js_export;

#[cfg(rust_1_30_or_newer)]
pub use stdweb_internal_macros::async_test;

#[cfg(feature = "futures-support")]
Expand Down
4 changes: 0 additions & 4 deletions stdweb-internal-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ keywords = ["web", "asmjs", "webasm", "javascript"]
categories = ["api-bindings", "gui", "web-programming"]
description = "Internal procedural macros for the `stdweb` crate"

build = "build.rs"

[lib]
proc-macro = true

Expand All @@ -29,5 +27,3 @@ version = "0.15"
default-features = false
features = ["full", "parsing", "printing", "clone-impls"]

[build-dependencies]
rustc_version = "0.2"
11 changes: 0 additions & 11 deletions stdweb-internal-macros/build.rs

This file was deleted.

4 changes: 0 additions & 4 deletions stdweb-internal-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,14 @@ extern crate serde;
extern crate serde_derive;
extern crate serde_json;

#[cfg(rust_1_30_or_newer)]
mod macro_js_export;
#[cfg(rust_1_30_or_newer)]
mod macro_async_test;

#[cfg(rust_1_30_or_newer)]
#[proc_macro_attribute]
pub fn js_export( attrs: proc_macro::TokenStream, input: proc_macro::TokenStream ) -> proc_macro::TokenStream {
macro_js_export::js_export( attrs, input )
}

#[cfg(rust_1_30_or_newer)]
#[proc_macro_attribute]
pub fn async_test( attrs: proc_macro::TokenStream, input: proc_macro::TokenStream ) -> proc_macro::TokenStream {
macro_async_test::async_test( attrs, input )
Expand Down

0 comments on commit f03c35b

Please sign in to comment.