mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-05-07 19:42:16 +00:00
Remove use_extern_macros
features
This has now been stabilized!
This commit is contained in:
parent
9c6225fd80
commit
d4297ad2d3
@ -13,8 +13,6 @@
|
|||||||
Import JavaScript things into Rust and export Rust things to JavaScript.
|
Import JavaScript things into Rust and export Rust things to JavaScript.
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
|
||||||
|
@ -33,8 +33,6 @@
|
|||||||
//! `Promise`.
|
//! `Promise`.
|
||||||
//!
|
//!
|
||||||
//! ```rust,no_run
|
//! ```rust,no_run
|
||||||
//! #![feature(use_extern_macros)]
|
|
||||||
//!
|
|
||||||
//! extern crate futures;
|
//! extern crate futures;
|
||||||
//! extern crate js_sys;
|
//! extern crate js_sys;
|
||||||
//! extern crate wasm_bindgen;
|
//! extern crate wasm_bindgen;
|
||||||
@ -104,7 +102,6 @@
|
|||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
#![deny(missing_docs)]
|
#![deny(missing_docs)]
|
||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
#![cfg(target_arch = "wasm32")]
|
#![cfg(target_arch = "wasm32")]
|
||||||
|
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
//! bindings.
|
//! bindings.
|
||||||
|
|
||||||
#![doc(html_root_url = "https://docs.rs/js-sys/0.2")]
|
#![doc(html_root_url = "https://docs.rs/js-sys/0.2")]
|
||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
#![cfg(target_arch = "wasm32")]
|
#![cfg(target_arch = "wasm32")]
|
||||||
|
|
||||||
extern crate wasm_bindgen_test;
|
extern crate wasm_bindgen_test;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#![cfg(target_arch = "wasm32")]
|
#![cfg(target_arch = "wasm32")]
|
||||||
#![feature(use_extern_macros)]
|
|
||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
|
|
||||||
extern crate js_sys;
|
extern crate js_sys;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
error: error parsing #[wasm_bindgen] attribute options: failed to parse anything
|
error: error parsing #[wasm_bindgen] attribute options: failed to parse anything
|
||||||
--> $DIR/attribute-fails-to-parse.rs:7:16
|
--> $DIR/attribute-fails-to-parse.rs:5:16
|
||||||
|
|
|
|
||||||
7 | #[wasm_bindgen(nonsense)]
|
5 | #[wasm_bindgen(nonsense)]
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
error: cannot return a borrowed ref with #[wasm_bindgen]
|
error: cannot return a borrowed ref with #[wasm_bindgen]
|
||||||
--> $DIR/bad-signatures.rs:8:17
|
--> $DIR/bad-signatures.rs:6:17
|
||||||
|
|
|
|
||||||
8 | pub fn foo() -> &u32 {}
|
6 | pub fn foo() -> &u32 {}
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
||||||
error: unsupported pattern in #[wasm_bindgen] imported function
|
error: unsupported pattern in #[wasm_bindgen] imported function
|
||||||
--> $DIR/bad-signatures.rs:12:12
|
--> $DIR/bad-signatures.rs:10:12
|
||||||
|
|
|
|
||||||
12 | fn foo(Foo(x): Foo);
|
10 | fn foo(Foo(x): Foo);
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
||||||
error: cannot return references in #[wasm_bindgen] imports yet
|
error: cannot return references in #[wasm_bindgen] imports yet
|
||||||
--> $DIR/bad-signatures.rs:14:17
|
--> $DIR/bad-signatures.rs:12:17
|
||||||
|
|
|
|
||||||
14 | fn foo() -> &u32;
|
12 | fn foo() -> &u32;
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
error: error parsing #[wasm_bindgen] attribute options: failed to parse anything
|
error: error parsing #[wasm_bindgen] attribute options: failed to parse anything
|
||||||
--> $DIR/invalid-attr.rs:7:16
|
--> $DIR/invalid-attr.rs:5:16
|
||||||
|
|
|
|
||||||
7 | #[wasm_bindgen(x)]
|
5 | #[wasm_bindgen(x)]
|
||||||
| ^
|
| ^
|
||||||
|
|
||||||
error: error parsing #[wasm_bindgen] attribute options: failed to parse anything
|
error: error parsing #[wasm_bindgen] attribute options: failed to parse anything
|
||||||
--> $DIR/invalid-attr.rs:12:20
|
--> $DIR/invalid-attr.rs:10:20
|
||||||
|
|
|
|
||||||
12 | #[wasm_bindgen(y)]
|
10 | #[wasm_bindgen(y)]
|
||||||
| ^
|
| ^
|
||||||
|
|
||||||
error: malformed #[wasm_bindgen] attribute
|
error: malformed #[wasm_bindgen] attribute
|
||||||
--> $DIR/invalid-attr.rs:15:5
|
--> $DIR/invalid-attr.rs:13:5
|
||||||
|
|
|
|
||||||
15 | #[wasm_bindgen { }]
|
13 | #[wasm_bindgen { }]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
error: only public enums are allowed with #[wasm_bindgen]
|
error: only public enums are allowed with #[wasm_bindgen]
|
||||||
--> $DIR/invalid-enums.rs:8:1
|
--> $DIR/invalid-enums.rs:6:1
|
||||||
|
|
|
|
||||||
8 | enum A {}
|
6 | enum A {}
|
||||||
| ^^^^^^^^^
|
| ^^^^^^^^^
|
||||||
|
|
||||||
error: only C-Style enums allowed with #[wasm_bindgen]
|
error: only C-Style enums allowed with #[wasm_bindgen]
|
||||||
--> $DIR/invalid-enums.rs:12:6
|
--> $DIR/invalid-enums.rs:10:6
|
||||||
|
|
|
|
||||||
12 | D(u32),
|
10 | D(u32),
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
||||||
error: enums with #[wasm_bidngen] may only have number literal values
|
error: enums with #[wasm_bidngen] may only have number literal values
|
||||||
--> $DIR/invalid-enums.rs:17:9
|
--> $DIR/invalid-enums.rs:15:9
|
||||||
|
|
|
|
||||||
17 | X = 1 + 3,
|
15 | X = 1 + 3,
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
||||||
error: enums with #[wasm_bindgen] can only support numbers that can be represented as u32
|
error: enums with #[wasm_bindgen] can only support numbers that can be represented as u32
|
||||||
--> $DIR/invalid-enums.rs:22:9
|
--> $DIR/invalid-enums.rs:20:9
|
||||||
|
|
|
|
||||||
22 | X = 4294967296,
|
20 | X = 4294967296,
|
||||||
| ^^^^^^^^^^
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
error: aborting due to 4 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,91 +1,91 @@
|
|||||||
error: it is currently not sound to use lifetimes in function signatures
|
error: it is currently not sound to use lifetimes in function signatures
|
||||||
--> $DIR/invalid-imports.rs:11:16
|
--> $DIR/invalid-imports.rs:9:16
|
||||||
|
|
|
|
||||||
11 | fn f() -> &'static u32;
|
9 | fn f() -> &'static u32;
|
||||||
| ^^^^^^^
|
| ^^^^^^^
|
||||||
|
|
||||||
error: imported methods must have at least one argument
|
error: imported methods must have at least one argument
|
||||||
--> $DIR/invalid-imports.rs:14:5
|
--> $DIR/invalid-imports.rs:12:5
|
||||||
|
|
|
|
||||||
14 | fn f1();
|
12 | fn f1();
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^
|
||||||
|
|
||||||
error: first argument of method must be a shared reference
|
error: first argument of method must be a shared reference
|
||||||
--> $DIR/invalid-imports.rs:16:14
|
--> $DIR/invalid-imports.rs:14:14
|
||||||
|
|
|
|
||||||
16 | fn f2(x: u32);
|
14 | fn f2(x: u32);
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
||||||
error: first argument of method must be a path
|
error: first argument of method must be a path
|
||||||
--> $DIR/invalid-imports.rs:18:14
|
--> $DIR/invalid-imports.rs:16:14
|
||||||
|
|
|
|
||||||
18 | fn f3(x: &&u32);
|
16 | fn f3(x: &&u32);
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
||||||
error: multi-segment paths are not supported yet
|
error: multi-segment paths are not supported yet
|
||||||
--> $DIR/invalid-imports.rs:20:15
|
--> $DIR/invalid-imports.rs:18:15
|
||||||
|
|
|
|
||||||
20 | fn f4(x: &foo::Bar);
|
18 | fn f4(x: &foo::Bar);
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^
|
||||||
|
|
||||||
error: global paths are not supported yet
|
error: global paths are not supported yet
|
||||||
|
--> $DIR/invalid-imports.rs:20:15
|
||||||
|
|
|
||||||
|
20 | fn f4(x: &::Bar);
|
||||||
|
| ^^^^^
|
||||||
|
|
||||||
|
error: paths with type parameters are not supported yet
|
||||||
--> $DIR/invalid-imports.rs:22:15
|
--> $DIR/invalid-imports.rs:22:15
|
||||||
|
|
|
|
||||||
22 | fn f4(x: &::Bar);
|
22 | fn f4(x: &Bar<T>);
|
||||||
| ^^^^^
|
| ^^^^^^
|
||||||
|
|
||||||
error: paths with type parameters are not supported yet
|
error: paths with type parameters are not supported yet
|
||||||
--> $DIR/invalid-imports.rs:24:15
|
--> $DIR/invalid-imports.rs:24:15
|
||||||
|
|
|
|
||||||
24 | fn f4(x: &Bar<T>);
|
24 | fn f4(x: &Fn(T));
|
||||||
| ^^^^^^
|
|
||||||
|
|
||||||
error: paths with type parameters are not supported yet
|
|
||||||
--> $DIR/invalid-imports.rs:26:15
|
|
||||||
|
|
|
||||||
26 | fn f4(x: &Fn(T));
|
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
||||||
error: constructor returns must be bare types
|
error: constructor returns must be bare types
|
||||||
--> $DIR/invalid-imports.rs:29:5
|
--> $DIR/invalid-imports.rs:27:5
|
||||||
|
|
|
|
||||||
29 | fn f();
|
27 | fn f();
|
||||||
| ^^^^^^^
|
| ^^^^^^^
|
||||||
|
|
||||||
error: global paths are not supported yet
|
error: global paths are not supported yet
|
||||||
--> $DIR/invalid-imports.rs:31:15
|
--> $DIR/invalid-imports.rs:29:15
|
||||||
|
|
|
|
||||||
31 | fn f() -> ::Bar;
|
29 | fn f() -> ::Bar;
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
||||||
error: return value of constructor must be a bare path
|
error: return value of constructor must be a bare path
|
||||||
--> $DIR/invalid-imports.rs:33:5
|
--> $DIR/invalid-imports.rs:31:5
|
||||||
|
|
|
|
||||||
33 | fn f() -> &Bar;
|
31 | fn f() -> &Bar;
|
||||||
| ^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: must be Result<...>
|
||||||
|
--> $DIR/invalid-imports.rs:34:15
|
||||||
|
|
|
||||||
|
34 | fn f() -> u32;
|
||||||
|
| ^^^
|
||||||
|
|
||||||
error: must be Result<...>
|
error: must be Result<...>
|
||||||
--> $DIR/invalid-imports.rs:36:15
|
--> $DIR/invalid-imports.rs:36:15
|
||||||
|
|
|
|
||||||
36 | fn f() -> u32;
|
36 | fn f() -> &u32;
|
||||||
| ^^^
|
|
||||||
|
|
||||||
error: must be Result<...>
|
|
||||||
--> $DIR/invalid-imports.rs:38:15
|
|
||||||
|
|
|
||||||
38 | fn f() -> &u32;
|
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
||||||
error: must have at least one generic parameter
|
error: must have at least one generic parameter
|
||||||
--> $DIR/invalid-imports.rs:40:15
|
--> $DIR/invalid-imports.rs:38:15
|
||||||
|
|
|
|
||||||
40 | fn f() -> Result<>;
|
38 | fn f() -> Result<>;
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^
|
||||||
|
|
||||||
error: it is currently not sound to use lifetimes in function signatures
|
error: it is currently not sound to use lifetimes in function signatures
|
||||||
--> $DIR/invalid-imports.rs:42:22
|
--> $DIR/invalid-imports.rs:40:22
|
||||||
|
|
|
|
||||||
42 | fn f() -> Result<'a>;
|
40 | fn f() -> Result<'a>;
|
||||||
| ^^
|
| ^^
|
||||||
|
|
||||||
error: aborting due to 15 previous errors
|
error: aborting due to 15 previous errors
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,67 +1,67 @@
|
|||||||
error: can only #[wasm_bindgen] public functions
|
error: can only #[wasm_bindgen] public functions
|
||||||
--> $DIR/invalid-items.rs:8:1
|
--> $DIR/invalid-items.rs:6:1
|
||||||
|
|
|
|
||||||
8 | fn foo() {}
|
6 | fn foo() {}
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
error: can only #[wasm_bindgen] safe functions
|
error: can only #[wasm_bindgen] safe functions
|
||||||
--> $DIR/invalid-items.rs:11:5
|
--> $DIR/invalid-items.rs:9:5
|
||||||
|
|
|
|
||||||
11 | pub unsafe fn foo1() {}
|
9 | pub unsafe fn foo1() {}
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
||||||
error: can only #[wasm_bindgen] non-const functions
|
error: can only #[wasm_bindgen] non-const functions
|
||||||
--> $DIR/invalid-items.rs:14:5
|
--> $DIR/invalid-items.rs:12:5
|
||||||
|
|
|
|
||||||
14 | pub const fn foo2() {}
|
12 | pub const fn foo2() {}
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
||||||
error: structs with #[wasm_bindgen] cannot have lifetime or type parameters currently
|
error: structs with #[wasm_bindgen] cannot have lifetime or type parameters currently
|
||||||
--> $DIR/invalid-items.rs:17:11
|
--> $DIR/invalid-items.rs:15:11
|
||||||
|
|
|
|
||||||
17 | struct Foo<T>(T);
|
15 | struct Foo<T>(T);
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
||||||
error: cannot import mutable globals yet
|
error: cannot import mutable globals yet
|
||||||
--> $DIR/invalid-items.rs:21:12
|
--> $DIR/invalid-items.rs:19:12
|
||||||
|
|
|
|
||||||
21 | static mut FOO: u32;
|
19 | static mut FOO: u32;
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
||||||
error: can't #[wasm_bindgen] variadic functions
|
error: can't #[wasm_bindgen] variadic functions
|
||||||
--> $DIR/invalid-items.rs:23:25
|
--> $DIR/invalid-items.rs:21:25
|
||||||
|
|
|
|
||||||
23 | pub fn foo3(x: i32, ...);
|
21 | pub fn foo3(x: i32, ...);
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
||||||
error: only foreign mods with the `C` ABI are allowed
|
error: only foreign mods with the `C` ABI are allowed
|
||||||
--> $DIR/invalid-items.rs:27:8
|
--> $DIR/invalid-items.rs:25:8
|
||||||
|
|
|
|
||||||
27 | extern "system" {
|
25 | extern "system" {
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^
|
||||||
|
|
||||||
|
error: can't #[wasm_bindgen] functions with lifetime or type parameters
|
||||||
|
--> $DIR/invalid-items.rs:29:12
|
||||||
|
|
|
||||||
|
29 | pub fn foo4<T>() {}
|
||||||
|
| ^^^
|
||||||
|
|
||||||
error: can't #[wasm_bindgen] functions with lifetime or type parameters
|
error: can't #[wasm_bindgen] functions with lifetime or type parameters
|
||||||
--> $DIR/invalid-items.rs:31:12
|
--> $DIR/invalid-items.rs:31:12
|
||||||
|
|
|
|
||||||
31 | pub fn foo4<T>() {}
|
31 | pub fn foo5<'a>() {}
|
||||||
| ^^^
|
| ^^^^
|
||||||
|
|
||||||
error: can't #[wasm_bindgen] functions with lifetime or type parameters
|
error: can't #[wasm_bindgen] functions with lifetime or type parameters
|
||||||
--> $DIR/invalid-items.rs:33:12
|
--> $DIR/invalid-items.rs:33:12
|
||||||
|
|
|
|
||||||
33 | pub fn foo5<'a>() {}
|
33 | pub fn foo6<'a, T>() {}
|
||||||
| ^^^^
|
|
||||||
|
|
||||||
error: can't #[wasm_bindgen] functions with lifetime or type parameters
|
|
||||||
--> $DIR/invalid-items.rs:35:12
|
|
||||||
|
|
|
||||||
35 | pub fn foo6<'a, T>() {}
|
|
||||||
| ^^^^^^^
|
| ^^^^^^^
|
||||||
|
|
||||||
error: #[wasm_bindgen] can only be applied to a function, struct, enum, impl, or extern block
|
error: #[wasm_bindgen] can only be applied to a function, struct, enum, impl, or extern block
|
||||||
--> $DIR/invalid-items.rs:38:1
|
--> $DIR/invalid-items.rs:36:1
|
||||||
|
|
|
|
||||||
38 | trait X {}
|
36 | trait X {}
|
||||||
| ^^^^^^^^^^
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
error: aborting due to 11 previous errors
|
error: aborting due to 11 previous errors
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,61 +1,61 @@
|
|||||||
error: #[wasm_bindgen] default impls are not supported
|
error: #[wasm_bindgen] default impls are not supported
|
||||||
--> $DIR/invalid-methods.rs:11:1
|
--> $DIR/invalid-methods.rs:9:1
|
||||||
|
|
|
|
||||||
11 | default impl A {
|
9 | default impl A {
|
||||||
| ^^^^^^^
|
| ^^^^^^^
|
||||||
|
|
||||||
error: #[wasm_bindgen] unsafe impls are not supported
|
error: #[wasm_bindgen] unsafe impls are not supported
|
||||||
--> $DIR/invalid-methods.rs:15:1
|
--> $DIR/invalid-methods.rs:13:1
|
||||||
|
|
|
|
||||||
15 | unsafe impl A {
|
13 | unsafe impl A {
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
||||||
error: #[wasm_bindgen] trait impls are not supported
|
error: #[wasm_bindgen] trait impls are not supported
|
||||||
--> $DIR/invalid-methods.rs:19:6
|
--> $DIR/invalid-methods.rs:17:6
|
||||||
|
|
|
|
||||||
19 | impl Clone for A {
|
17 | impl Clone for A {
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
||||||
error: #[wasm_bindgen] generic impls aren't supported
|
error: #[wasm_bindgen] generic impls aren't supported
|
||||||
--> $DIR/invalid-methods.rs:23:5
|
--> $DIR/invalid-methods.rs:21:5
|
||||||
|
|
|
|
||||||
23 | impl<T> A {
|
21 | impl<T> A {
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
||||||
error: unsupported self type in #[wasm_bindgen] impl
|
error: unsupported self type in #[wasm_bindgen] impl
|
||||||
--> $DIR/invalid-methods.rs:27:6
|
--> $DIR/invalid-methods.rs:25:6
|
||||||
|
|
|
|
||||||
27 | impl &'static A {
|
25 | impl &'static A {
|
||||||
| ^^^^^^^^^^
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
error: const definitions aren't supported with #[wasm_bindgen]
|
error: const definitions aren't supported with #[wasm_bindgen]
|
||||||
--> $DIR/invalid-methods.rs:34:5
|
--> $DIR/invalid-methods.rs:32:5
|
||||||
|
|
|
|
||||||
34 | const X: u32 = 3;
|
32 | const X: u32 = 3;
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: type definitions in impls aren't supported with #[wasm_bindgen]
|
error: type definitions in impls aren't supported with #[wasm_bindgen]
|
||||||
--> $DIR/invalid-methods.rs:35:5
|
--> $DIR/invalid-methods.rs:33:5
|
||||||
|
|
|
|
||||||
35 | type Y = u32;
|
33 | type Y = u32;
|
||||||
| ^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: macros in impls aren't supported
|
error: macros in impls aren't supported
|
||||||
--> $DIR/invalid-methods.rs:36:5
|
--> $DIR/invalid-methods.rs:34:5
|
||||||
|
|
|
|
||||||
36 | x!();
|
34 | x!();
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
||||||
error: can only #[wasm_bindgen] non-const functions
|
error: can only #[wasm_bindgen] non-const functions
|
||||||
--> $DIR/invalid-methods.rs:41:9
|
--> $DIR/invalid-methods.rs:39:9
|
||||||
|
|
|
|
||||||
41 | pub const fn foo() {}
|
39 | pub const fn foo() {}
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
||||||
error: can only bindgen safe functions
|
error: can only bindgen safe functions
|
||||||
--> $DIR/invalid-methods.rs:42:9
|
--> $DIR/invalid-methods.rs:40:9
|
||||||
|
|
|
|
||||||
42 | pub unsafe fn foo() {}
|
40 | pub unsafe fn foo() {}
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
||||||
error: aborting due to 10 previous errors
|
error: aborting due to 10 previous errors
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
error: can only #[wasm_bindgen] public functions
|
error: can only #[wasm_bindgen] public functions
|
||||||
--> $DIR/non-public-function.rs:8:1
|
--> $DIR/non-public-function.rs:6:1
|
||||||
|
|
|
|
||||||
8 | fn foo() {}
|
6 | fn foo() {}
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -38,8 +38,6 @@ ton of documentation just yet, but a taste of how it works is:
|
|||||||
|
|
||||||
```rust
|
```rust
|
||||||
// in tests/wasm.rs
|
// in tests/wasm.rs
|
||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen_test;
|
extern crate wasm_bindgen_test;
|
||||||
|
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
extern crate js_sys;
|
extern crate js_sys;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
extern crate sample;
|
extern crate sample;
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
extern crate sample;
|
extern crate sample;
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
//!
|
//!
|
||||||
//! More documentation can be found in the README for this crate!
|
//! More documentation can be found in the README for this crate!
|
||||||
|
|
||||||
#![feature(use_extern_macros)]
|
|
||||||
#![deny(missing_docs)]
|
#![deny(missing_docs)]
|
||||||
|
|
||||||
extern crate console_error_panic_hook;
|
extern crate console_error_panic_hook;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
#![cfg(target_arch = "wasm32")]
|
#![cfg(target_arch = "wasm32")]
|
||||||
|
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate js_sys;
|
extern crate js_sys;
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
extern crate wasm_bindgen_test;
|
extern crate wasm_bindgen_test;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate js_sys;
|
extern crate js_sys;
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
extern crate web_sys;
|
extern crate web_sys;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
extern crate js_sys;
|
extern crate js_sys;
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
extern crate web_sys;
|
extern crate web_sys;
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
#![allow(unused_variables, dead_code)]
|
#![allow(unused_variables, dead_code)]
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate humantime;
|
extern crate humantime;
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#![feature(use_extern_macros, nll)]
|
#![feature(nll)]
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
extern crate web_sys;
|
extern crate web_sys;
|
||||||
@ -144,4 +144,4 @@ impl FmOsc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,6 @@ wasm-bindgen = "0.2"
|
|||||||
Next up our actual code! We'll write this in `src/lib.rs`:
|
Next up our actual code! We'll write this in `src/lib.rs`:
|
||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ can also [explore this code online](https://webassembly.studio/?f=t61j18noqz):
|
|||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
// src/lib.rs
|
// src/lib.rs
|
||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
//! this crate and this crate also provides JS bindings through the `JsValue`
|
//! this crate and this crate also provides JS bindings through the `JsValue`
|
||||||
//! interface.
|
//! interface.
|
||||||
|
|
||||||
#![feature(use_extern_macros, unsize)]
|
#![feature(unsize)]
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![doc(html_root_url = "https://docs.rs/wasm-bindgen/0.2")]
|
#![doc(html_root_url = "https://docs.rs/wasm-bindgen/0.2")]
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#![cfg(target_arch = "wasm32")]
|
#![cfg(target_arch = "wasm32")]
|
||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen_test;
|
extern crate wasm_bindgen_test;
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
//! This doesn't actually run any tests, it's mostly a compile-time verification
|
//! This doesn't actually run any tests, it's mostly a compile-time verification
|
||||||
//! that things work.
|
//! that things work.
|
||||||
|
|
||||||
#![feature(use_extern_macros)]
|
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
//! `wasm-bindgen` is compiled itself with the `std` feature and everything
|
//! `wasm-bindgen` is compiled itself with the `std` feature and everything
|
||||||
//! works out just fine.
|
//! works out just fine.
|
||||||
|
|
||||||
#![feature(use_extern_macros)]
|
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#![cfg(target_arch = "wasm32")]
|
#![cfg(target_arch = "wasm32")]
|
||||||
#![feature(use_extern_macros)]
|
|
||||||
|
|
||||||
extern crate wasm_bindgen_test;
|
extern crate wasm_bindgen_test;
|
||||||
extern crate wasm_bindgen;
|
extern crate wasm_bindgen;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user