Skip to content

Commit 906cd7a

Browse files
committed
Remove usage of wasm_import_module feature
This is now stabilized! Also tweak usage of it to the stable version.
1 parent 13269a9 commit 906cd7a

File tree

48 files changed

+121
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+121
-122
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Import JavaScript things into Rust and export Rust things to JavaScript.
2020
`src/lib.rs`:
2121

2222
```rust
23-
#![feature(use_extern_macros, wasm_import_module)]
23+
#![feature(use_extern_macros)]
2424

2525
extern crate wasm_bindgen;
2626
use wasm_bindgen::prelude::*;

crates/backend/src/codegen.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl ToTokens for ast::Struct {
148148
unsafe { &mut ::wasm_bindgen::convert::GlobalStack::new() },
149149
);
150150

151-
#[wasm_import_module = "__wbindgen_placeholder__"]
151+
#[link(wasm_import_module = "__wbindgen_placeholder__")]
152152
extern {
153153
fn #new_fn(ptr: u32) -> u32;
154154
}
@@ -784,7 +784,7 @@ impl ToTokens for ast::ImportFunction {
784784
#vis fn #rust_name(#me #(#arguments),*) #ret {
785785
// See definition of `link_mem_intrinsics` for what this is doing
786786
::wasm_bindgen::__rt::link_mem_intrinsics();
787-
#[wasm_import_module = "__wbindgen_placeholder__"]
787+
#[link(wasm_import_module = "__wbindgen_placeholder__")]
788788
extern {
789789
fn #import_name(#(#abi_arguments),*) -> #abi_ret;
790790
}
@@ -910,7 +910,7 @@ impl ToTokens for ast::ImportStatic {
910910
#vis static #name: ::wasm_bindgen::JsStatic<#ty> = {
911911
#[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))]
912912
fn init() -> #ty {
913-
#[wasm_import_module = "__wbindgen_placeholder__"]
913+
#[link(wasm_import_module = "__wbindgen_placeholder__")]
914914
extern {
915915
fn #shim_name() -> <#ty as ::wasm_bindgen::convert::FromWasmAbi>::Abi;
916916
}

crates/js-sys/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//! bindings.
1818
1919
#![doc(html_root_url = "https://docs.rs/js-sys/0.2")]
20-
#![feature(use_extern_macros, wasm_import_module)]
20+
#![feature(use_extern_macros)]
2121

2222
extern crate wasm_bindgen;
2323

crates/js-sys/tests/wasm/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![cfg(target_arch = "wasm32")]
2-
#![feature(use_extern_macros, wasm_import_module)]
2+
#![feature(use_extern_macros)]
33
#![allow(non_snake_case)]
44

55
extern crate js_sys;

crates/test/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! More documentation can be found in the README for this crate!
44
5-
#![feature(use_extern_macros, wasm_import_module)]
5+
#![feature(use_extern_macros)]
66

77
extern crate wasm_bindgen_test_macro;
88
extern crate wasm_bindgen;

crates/web-sys/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(wasm_import_module)]
21
#![doc(html_root_url = "https://docs.rs/web-sys/0.2")]
32

43
extern crate wasm_bindgen;

crates/web-sys/tests/all/headers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn headers() {
66
.file(
77
"src/lib.rs",
88
r#"
9-
#![feature(use_extern_macros, wasm_import_module)]
9+
#![feature(use_extern_macros)]
1010
extern crate wasm_bindgen;
1111
use wasm_bindgen::prelude::*;
1212
extern crate web_sys;

crates/webidl/tests/all/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ fn take_and_return_a_bunch_of_slices() {
102102
.file(
103103
"src/lib.rs",
104104
r#"
105-
#![feature(use_extern_macros, wasm_import_module)]
105+
#![feature(use_extern_macros)]
106106
107107
extern crate wasm_bindgen;
108108

crates/webidl/tests/all/consts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn bool() {
2424
.file(
2525
"src/lib.rs",
2626
r#"
27-
#![feature(use_extern_macros, wasm_import_module)]
27+
#![feature(use_extern_macros)]
2828
extern crate wasm_bindgen;
2929
use wasm_bindgen::prelude::*;
3030
@@ -93,7 +93,7 @@ fn ints() {
9393
.file(
9494
"src/lib.rs",
9595
r#"
96-
#![feature(use_extern_macros, wasm_import_module)]
96+
#![feature(use_extern_macros)]
9797
extern crate wasm_bindgen;
9898
use wasm_bindgen::prelude::*;
9999
@@ -160,7 +160,7 @@ fn floats() {
160160
.file(
161161
"src/lib.rs",
162162
r#"
163-
#![feature(use_extern_macros, wasm_import_module)]
163+
#![feature(use_extern_macros)]
164164
extern crate wasm_bindgen;
165165
use wasm_bindgen::prelude::*;
166166

crates/webidl/tests/all/enums.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fn top_level_enum() {
3939
.file(
4040
"src/lib.rs",
4141
r#"
42-
#![feature(use_extern_macros, wasm_import_module)]
42+
#![feature(use_extern_macros)]
4343
4444
extern crate wasm_bindgen;
4545

crates/webidl/tests/all/simple.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn method() {
2929
.file(
3030
"src/lib.rs",
3131
r#"
32-
#![feature(use_extern_macros, wasm_import_module)]
32+
#![feature(use_extern_macros)]
3333
3434
extern crate wasm_bindgen;
3535
@@ -87,7 +87,7 @@ fn property() {
8787
.file(
8888
"src/lib.rs",
8989
r#"
90-
#![feature(use_extern_macros, wasm_import_module)]
90+
#![feature(use_extern_macros)]
9191
9292
extern crate wasm_bindgen;
9393
@@ -149,7 +149,7 @@ fn named_constructor() {
149149
.file(
150150
"src/lib.rs",
151151
r#"
152-
#![feature(use_extern_macros, wasm_import_module)]
152+
#![feature(use_extern_macros)]
153153
154154
extern crate wasm_bindgen;
155155
@@ -198,7 +198,7 @@ fn static_method() {
198198
.file(
199199
"src/lib.rs",
200200
r#"
201-
#![feature(use_extern_macros, wasm_import_module)]
201+
#![feature(use_extern_macros)]
202202
203203
extern crate wasm_bindgen;
204204
@@ -251,7 +251,7 @@ fn static_property() {
251251
.file(
252252
"src/lib.rs",
253253
r#"
254-
#![feature(use_extern_macros, wasm_import_module)]
254+
#![feature(use_extern_macros)]
255255
256256
extern crate wasm_bindgen;
257257
@@ -303,7 +303,7 @@ fn one_method_using_an_undefined_import_doesnt_break_all_other_methods() {
303303
.file(
304304
"src/lib.rs",
305305
r#"
306-
#![feature(use_extern_macros, wasm_import_module)]
306+
#![feature(use_extern_macros)]
307307
extern crate wasm_bindgen;
308308
use wasm_bindgen::prelude::*;
309309
@@ -348,7 +348,7 @@ fn unforgeable_is_structural() {
348348
.file(
349349
"src/lib.rs",
350350
r#"
351-
#![feature(use_extern_macros, wasm_import_module)]
351+
#![feature(use_extern_macros)]
352352
extern crate wasm_bindgen;
353353
use wasm_bindgen::prelude::*;
354354
@@ -405,7 +405,7 @@ fn partial_interface() {
405405
.file(
406406
"src/lib.rs",
407407
r#"
408-
#![feature(use_extern_macros, wasm_import_module)]
408+
#![feature(use_extern_macros)]
409409
extern crate wasm_bindgen;
410410
use wasm_bindgen::prelude::*;
411411
@@ -471,7 +471,7 @@ fn mixin() {
471471
.file(
472472
"src/lib.rs",
473473
r#"
474-
#![feature(use_extern_macros, wasm_import_module)]
474+
#![feature(use_extern_macros)]
475475
extern crate wasm_bindgen;
476476
use wasm_bindgen::prelude::*;
477477

crates/webidl/tests/all/throws.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn throws() {
6464
.file(
6565
"src/lib.rs",
6666
r#"
67-
#![feature(use_extern_macros, wasm_import_module)]
67+
#![feature(use_extern_macros)]
6868
extern crate wasm_bindgen;
6969
use wasm_bindgen::prelude::*;
7070

examples/add/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module)]
1+
#![feature(use_extern_macros)]
22

33
extern crate wasm_bindgen;
44

examples/asm.js/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module)]
1+
#![feature(use_extern_macros)]
22

33
extern crate wasm_bindgen;
44

examples/char/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module)]
1+
#![feature(use_extern_macros)]
22

33
extern crate wasm_bindgen;
44

examples/closures/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module)]
1+
#![feature(use_extern_macros)]
22

33
extern crate wasm_bindgen;
44
extern crate js_sys;

examples/comments/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module)]
1+
#![feature(use_extern_macros)]
22

33
extern crate wasm_bindgen;
44

examples/console_log/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module)]
1+
#![feature(use_extern_macros)]
22

33
extern crate wasm_bindgen;
44

examples/dom/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module)]
1+
#![feature(use_extern_macros)]
22

33
extern crate wasm_bindgen;
44

examples/hello_world/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module)]
1+
#![feature(use_extern_macros)]
22

33
extern crate wasm_bindgen;
44

examples/import_js/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module)]
1+
#![feature(use_extern_macros)]
22

33
extern crate wasm_bindgen;
44

examples/julia_set/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module, js_globals)]
1+
#![feature(use_extern_macros)]
22

33
extern crate wasm_bindgen;
44
use wasm_bindgen::prelude::*;

examples/math/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module)]
1+
#![feature(use_extern_macros)]
22

33
extern crate wasm_bindgen;
44

examples/no_modules/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module)]
1+
#![feature(use_extern_macros)]
22

33
extern crate wasm_bindgen;
44

examples/performance/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module)]
1+
#![feature(use_extern_macros)]
22

33
extern crate humantime;
44
extern crate wasm_bindgen;

examples/smorgasboard/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module)]
1+
#![feature(use_extern_macros)]
22

33
extern crate wasm_bindgen;
44

examples/wasm-in-wasm/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(use_extern_macros, wasm_import_module)]
1+
#![feature(use_extern_macros)]
22

33
extern crate wasm_bindgen;
44

guide/src/basic-usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ wasm-bindgen = "0.2"
3939
Next up our actual code! We'll write this in `src/lib.rs`:
4040

4141
```rust,ignore
42-
#![feature(use_extern_macros, wasm_import_module)]
42+
#![feature(use_extern_macros)]
4343
4444
extern crate wasm_bindgen;
4545
use wasm_bindgen::prelude::*;

guide/src/what-else-can-we-do.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ can also [explore this code online](https://webassembly.studio/?f=t61j18noqz):
55

66
```rust,ignore
77
// src/lib.rs
8-
#![feature(use_extern_macros, wasm_import_module)]
8+
#![feature(use_extern_macros)]
99
1010
extern crate wasm_bindgen;
1111

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! this crate and this crate also provides JS bindings through the `JsValue`
66
//! interface.
77
8-
#![feature(use_extern_macros, wasm_import_module, unsize)]
8+
#![feature(use_extern_macros, unsize)]
99
#![no_std]
1010
#![doc(html_root_url = "https://docs.rs/wasm-bindgen/0.2")]
1111

@@ -368,7 +368,7 @@ numbers! { i8 u8 i16 u16 i32 u32 f32 f64 }
368368
macro_rules! externs {
369369
($(fn $name:ident($($args:tt)*) -> $ret:ty;)*) => (
370370
#[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))]
371-
#[wasm_import_module = "__wbindgen_placeholder__"]
371+
#[link(wasm_import_module = "__wbindgen_placeholder__")]
372372
extern {
373373
$(fn $name($($args)*) -> $ret;)*
374374
}

tests/all/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ fn null_keeps_working() {
201201
.file(
202202
"src/lib.rs",
203203
r#"
204-
#![feature(use_extern_macros, wasm_import_module)]
204+
#![feature(use_extern_macros)]
205205
206206
extern crate wasm_bindgen;
207207

tests/all/char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn works() {
66
.file(
77
"src/lib.rs",
88
r#"
9-
#![feature(use_extern_macros, wasm_import_module)]
9+
#![feature(use_extern_macros)]
1010
1111
extern crate wasm_bindgen;
1212

0 commit comments

Comments
 (0)