diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/wasm-bindgen-macro/ui-tests | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/wasm-bindgen-macro/ui-tests')
25 files changed, 300 insertions, 146 deletions
diff --git a/vendor/wasm-bindgen-macro/ui-tests/async-errors.stderr b/vendor/wasm-bindgen-macro/ui-tests/async-errors.stderr index c1fec077d..cf833c87d 100644 --- a/vendor/wasm-bindgen-macro/ui-tests/async-errors.stderr +++ b/vendor/wasm-bindgen-macro/ui-tests/async-errors.stderr @@ -4,14 +4,9 @@ error[E0277]: the trait bound `Result<(), ()>: IntoJsResult` is not satisfied 30 | #[wasm_bindgen] | ^^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result<(), ()>` | - = help: the following implementations were found: - <Result<(), E> as IntoJsResult> - <Result<T, E> as IntoJsResult> -note: required by `into_js_result` - --> $WORKSPACE/src/lib.rs - | - | fn into_js_result(self) -> Result<JsValue, JsValue>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: the following other types implement trait `IntoJsResult`: + Result<(), E> + Result<T, E> = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Result<(), BadType>: IntoJsResult` is not satisfied @@ -20,14 +15,9 @@ error[E0277]: the trait bound `Result<(), BadType>: IntoJsResult` is not satisfi 32 | #[wasm_bindgen] | ^^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result<(), BadType>` | - = help: the following implementations were found: - <Result<(), E> as IntoJsResult> - <Result<T, E> as IntoJsResult> -note: required by `into_js_result` - --> $WORKSPACE/src/lib.rs - | - | fn into_js_result(self) -> Result<JsValue, JsValue>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: the following other types implement trait `IntoJsResult`: + Result<(), E> + Result<T, E> = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `wasm_bindgen::JsValue: From<BadType>` is not satisfied @@ -36,19 +26,18 @@ error[E0277]: the trait bound `wasm_bindgen::JsValue: From<BadType>` is not sati 34 | #[wasm_bindgen] | ^^^^^^^^^^^^^^^ the trait `From<BadType>` is not implemented for `wasm_bindgen::JsValue` | - = help: the following implementations were found: + = help: the following other types implement trait `From<T>`: <wasm_bindgen::JsValue as From<&'a String>> <wasm_bindgen::JsValue as From<&'a T>> <wasm_bindgen::JsValue as From<&'a str>> <wasm_bindgen::JsValue as From<*const T>> - and $N others - = note: required because of the requirements on the impl of `Into<wasm_bindgen::JsValue>` for `BadType` - = note: required because of the requirements on the impl of `IntoJsResult` for `BadType` -note: required by `into_js_result` - --> $WORKSPACE/src/lib.rs - | - | fn into_js_result(self) -> Result<JsValue, JsValue>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + <wasm_bindgen::JsValue as From<*mut T>> + <wasm_bindgen::JsValue as From<JsError>> + <wasm_bindgen::JsValue as From<MyType>> + <wasm_bindgen::JsValue as From<Option<T>>> + and 72 others + = note: required for `BadType` to implement `Into<wasm_bindgen::JsValue>` + = note: required for `BadType` to implement `IntoJsResult` = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Result<BadType, wasm_bindgen::JsValue>: IntoJsResult` is not satisfied @@ -57,12 +46,7 @@ error[E0277]: the trait bound `Result<BadType, wasm_bindgen::JsValue>: IntoJsRes 36 | #[wasm_bindgen] | ^^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result<BadType, wasm_bindgen::JsValue>` | - = help: the following implementations were found: - <Result<(), E> as IntoJsResult> - <Result<T, E> as IntoJsResult> -note: required by `into_js_result` - --> $WORKSPACE/src/lib.rs - | - | fn into_js_result(self) -> Result<JsValue, JsValue>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: the following other types implement trait `IntoJsResult`: + Result<(), E> + Result<T, E> = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/vendor/wasm-bindgen-macro/ui-tests/invalid-imports.rs b/vendor/wasm-bindgen-macro/ui-tests/invalid-imports.rs index ecd223b70..ceb7d33bf 100644 --- a/vendor/wasm-bindgen-macro/ui-tests/invalid-imports.rs +++ b/vendor/wasm-bindgen-macro/ui-tests/invalid-imports.rs @@ -19,7 +19,7 @@ extern "C" { #[wasm_bindgen(method)] fn f4(x: &Bar<T>); #[wasm_bindgen(method)] - fn f4(x: &Fn(T)); + fn f4(x: &dyn Fn(T)); #[wasm_bindgen(constructor)] fn f(); diff --git a/vendor/wasm-bindgen-macro/ui-tests/invalid-imports.stderr b/vendor/wasm-bindgen-macro/ui-tests/invalid-imports.stderr index aeb09c574..c83c040e8 100644 --- a/vendor/wasm-bindgen-macro/ui-tests/invalid-imports.stderr +++ b/vendor/wasm-bindgen-macro/ui-tests/invalid-imports.stderr @@ -1,71 +1,71 @@ error: it is currently not sound to use lifetimes in function signatures - --> $DIR/invalid-imports.rs:7:16 + --> ui-tests/invalid-imports.rs:7:16 | 7 | fn f() -> &'static u32; | ^^^^^^^ error: imported methods must have at least one argument - --> $DIR/invalid-imports.rs:10:5 + --> ui-tests/invalid-imports.rs:10:5 | 10 | fn f1(); | ^^^^^^^^ error: first argument of method must be a shared reference - --> $DIR/invalid-imports.rs:12:14 + --> ui-tests/invalid-imports.rs:12:14 | 12 | fn f2(x: u32); | ^^^ error: first argument of method must be a path - --> $DIR/invalid-imports.rs:14:14 + --> ui-tests/invalid-imports.rs:14:15 | 14 | fn f3(x: &&u32); - | ^^^^^ + | ^^^^ error: paths with type parameters are not supported yet - --> $DIR/invalid-imports.rs:20:15 + --> ui-tests/invalid-imports.rs:20:15 | 20 | fn f4(x: &Bar<T>); | ^^^^^^ -error: paths with type parameters are not supported yet - --> $DIR/invalid-imports.rs:22:15 +error: first argument of method must be a path + --> ui-tests/invalid-imports.rs:22:15 | -22 | fn f4(x: &Fn(T)); - | ^^^^^ +22 | fn f4(x: &dyn Fn(T)); + | ^^^^^^^^^ error: constructor returns must be bare types - --> $DIR/invalid-imports.rs:25:5 + --> ui-tests/invalid-imports.rs:25:5 | 25 | fn f(); | ^^^^^^^ error: return value of constructor must be a bare path - --> $DIR/invalid-imports.rs:29:5 + --> ui-tests/invalid-imports.rs:29:5 | 29 | fn f() -> &Bar; | ^^^^^^^^^^^^^^^ error: must be Result<...> - --> $DIR/invalid-imports.rs:32:15 + --> ui-tests/invalid-imports.rs:32:15 | 32 | fn f() -> u32; | ^^^ error: must be Result<...> - --> $DIR/invalid-imports.rs:34:15 + --> ui-tests/invalid-imports.rs:34:15 | 34 | fn f() -> &u32; | ^^^^ error: must have at least one generic parameter - --> $DIR/invalid-imports.rs:36:15 + --> ui-tests/invalid-imports.rs:36:15 | 36 | fn f() -> Result<>; | ^^^^^^^^ error: it is currently not sound to use lifetimes in function signatures - --> $DIR/invalid-imports.rs:38:22 + --> ui-tests/invalid-imports.rs:38:22 | 38 | fn f() -> Result<'a>; | ^^ diff --git a/vendor/wasm-bindgen-macro/ui-tests/invalid-methods.stderr b/vendor/wasm-bindgen-macro/ui-tests/invalid-methods.stderr index a785fc1ff..798e1af9a 100644 --- a/vendor/wasm-bindgen-macro/ui-tests/invalid-methods.stderr +++ b/vendor/wasm-bindgen-macro/ui-tests/invalid-methods.stderr @@ -1,61 +1,61 @@ error: #[wasm_bindgen] default impls are not supported - --> $DIR/invalid-methods.rs:7:1 + --> ui-tests/invalid-methods.rs:7:1 | 7 | default impl A { | ^^^^^^^ error: #[wasm_bindgen] unsafe impls are not supported - --> $DIR/invalid-methods.rs:11:1 + --> ui-tests/invalid-methods.rs:11:1 | 11 | unsafe impl A { | ^^^^^^ error: #[wasm_bindgen] trait impls are not supported - --> $DIR/invalid-methods.rs:15:6 + --> ui-tests/invalid-methods.rs:15:6 | 15 | impl Clone for A { | ^^^^^ error: #[wasm_bindgen] generic impls aren't supported - --> $DIR/invalid-methods.rs:19:5 + --> ui-tests/invalid-methods.rs:19:5 | 19 | impl<T> A { | ^^^ error: unsupported self type in #[wasm_bindgen] impl - --> $DIR/invalid-methods.rs:23:6 + --> ui-tests/invalid-methods.rs:23:6 | 23 | impl &'static A { | ^^^^^^^^^^ error: const definitions aren't supported with #[wasm_bindgen] - --> $DIR/invalid-methods.rs:30:5 + --> ui-tests/invalid-methods.rs:30:5 | 30 | const X: u32 = 3; | ^^^^^^^^^^^^^^^^^ error: type definitions in impls aren't supported with #[wasm_bindgen] - --> $DIR/invalid-methods.rs:31:5 + --> ui-tests/invalid-methods.rs:31:5 | 31 | type Y = u32; | ^^^^^^^^^^^^^ error: macros in impls aren't supported - --> $DIR/invalid-methods.rs:32:5 + --> ui-tests/invalid-methods.rs:32:5 | 32 | x!(); | ^^^^^ error: can only #[wasm_bindgen] non-const functions - --> $DIR/invalid-methods.rs:39:9 + --> ui-tests/invalid-methods.rs:39:9 | 39 | pub const fn foo() {} | ^^^^^ -warning: unused macro definition - --> $DIR/invalid-methods.rs:26:1 +warning: unused macro definition: `x` + --> ui-tests/invalid-methods.rs:26:14 | 26 | macro_rules! x { () => () } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^ | = note: `#[warn(unused_macros)]` on by default diff --git a/vendor/wasm-bindgen-macro/ui-tests/main-async.rs b/vendor/wasm-bindgen-macro/ui-tests/main-async.rs new file mode 100644 index 000000000..8e11f45b3 --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/main-async.rs @@ -0,0 +1,7 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(main)] +async fn main() {} + +#[wasm_bindgen(main)] +fn fail() {} diff --git a/vendor/wasm-bindgen-macro/ui-tests/main-async.stderr b/vendor/wasm-bindgen-macro/ui-tests/main-async.stderr new file mode 100644 index 000000000..71c4689a0 --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/main-async.stderr @@ -0,0 +1,5 @@ +error: the main function has to be called main + --> ui-tests/main-async.rs:7:4 + | +7 | fn fail() {} + | ^^^^ diff --git a/vendor/wasm-bindgen-macro/ui-tests/main-debug.rs b/vendor/wasm-bindgen-macro/ui-tests/main-debug.rs new file mode 100644 index 000000000..2fc9aa7ca --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/main-debug.rs @@ -0,0 +1,18 @@ +use std::fmt; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(main)] +fn main() -> Result<(), Test> { + unimplemented!() +} + +struct Test; + +impl fmt::Debug for Test { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + unimplemented!() + } +} + +#[wasm_bindgen(main)] +fn fail() {} diff --git a/vendor/wasm-bindgen-macro/ui-tests/main-debug.stderr b/vendor/wasm-bindgen-macro/ui-tests/main-debug.stderr new file mode 100644 index 000000000..2b3c670ec --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/main-debug.stderr @@ -0,0 +1,5 @@ +error: the main function has to be called main + --> ui-tests/main-debug.rs:18:4 + | +18 | fn fail() {} + | ^^^^ diff --git a/vendor/wasm-bindgen-macro/ui-tests/main-infallible.rs b/vendor/wasm-bindgen-macro/ui-tests/main-infallible.rs new file mode 100644 index 000000000..75ccd429a --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/main-infallible.rs @@ -0,0 +1,10 @@ +use std::convert::Infallible; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(main)] +fn main() -> Infallible { + unimplemented!() +} + +#[wasm_bindgen(main)] +fn fail() {} diff --git a/vendor/wasm-bindgen-macro/ui-tests/main-infallible.stderr b/vendor/wasm-bindgen-macro/ui-tests/main-infallible.stderr new file mode 100644 index 000000000..fd8c9c997 --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/main-infallible.stderr @@ -0,0 +1,5 @@ +error: the main function has to be called main + --> ui-tests/main-infallible.rs:10:4 + | +10 | fn fail() {} + | ^^^^ diff --git a/vendor/wasm-bindgen-macro/ui-tests/main-jsvalue.rs b/vendor/wasm-bindgen-macro/ui-tests/main-jsvalue.rs new file mode 100644 index 000000000..d2f5816ac --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/main-jsvalue.rs @@ -0,0 +1,9 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(main)] +fn main() -> Result<(), JsValue> { + unimplemented!() +} + +#[wasm_bindgen(main)] +fn fail() {} diff --git a/vendor/wasm-bindgen-macro/ui-tests/main-jsvalue.stderr b/vendor/wasm-bindgen-macro/ui-tests/main-jsvalue.stderr new file mode 100644 index 000000000..6d32d6209 --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/main-jsvalue.stderr @@ -0,0 +1,5 @@ +error: the main function has to be called main + --> ui-tests/main-jsvalue.rs:9:4 + | +9 | fn fail() {} + | ^^^^ diff --git a/vendor/wasm-bindgen-macro/ui-tests/main-unit.rs b/vendor/wasm-bindgen-macro/ui-tests/main-unit.rs new file mode 100644 index 000000000..5e04c8dc7 --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/main-unit.rs @@ -0,0 +1,7 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(main)] +fn main() -> () {} + +#[wasm_bindgen(main)] +fn fail() {} diff --git a/vendor/wasm-bindgen-macro/ui-tests/main-unit.stderr b/vendor/wasm-bindgen-macro/ui-tests/main-unit.stderr new file mode 100644 index 000000000..f49066e90 --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/main-unit.stderr @@ -0,0 +1,5 @@ +error: the main function has to be called main + --> ui-tests/main-unit.rs:7:4 + | +7 | fn fail() {} + | ^^^^ diff --git a/vendor/wasm-bindgen-macro/ui-tests/main.rs b/vendor/wasm-bindgen-macro/ui-tests/main.rs new file mode 100644 index 000000000..5babfb92a --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/main.rs @@ -0,0 +1,7 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(main)] +fn main() {} + +#[wasm_bindgen(main)] +fn fail() {} diff --git a/vendor/wasm-bindgen-macro/ui-tests/main.stderr b/vendor/wasm-bindgen-macro/ui-tests/main.stderr new file mode 100644 index 000000000..94f13b1db --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/main.stderr @@ -0,0 +1,5 @@ +error: the main function has to be called main + --> ui-tests/main.rs:7:4 + | +7 | fn fail() {} + | ^^^^ diff --git a/vendor/wasm-bindgen-macro/ui-tests/missing-catch.stderr b/vendor/wasm-bindgen-macro/ui-tests/missing-catch.stderr index d08553b1b..55466de06 100644 --- a/vendor/wasm-bindgen-macro/ui-tests/missing-catch.stderr +++ b/vendor/wasm-bindgen-macro/ui-tests/missing-catch.stderr @@ -4,14 +4,13 @@ error[E0277]: the trait bound `Result<wasm_bindgen::JsValue, wasm_bindgen::JsVal 6 | pub fn foo() -> Result<JsValue, JsValue>; | ^^^ the trait `FromWasmAbi` is not implemented for `Result<wasm_bindgen::JsValue, wasm_bindgen::JsValue>` | -note: required by a bound in `FromWasmAbi` - --> $WORKSPACE/src/convert/traits.rs - | - | / pub trait FromWasmAbi: WasmDescribe { - | | /// The wasm ABI type that this converts from when coming back out from the - | | /// ABI boundary. - | | type Abi: WasmAbi; -... | - | | unsafe fn from_abi(js: Self::Abi) -> Self; - | | } - | |_^ required by this bound in `FromWasmAbi` + = help: the following other types implement trait `FromWasmAbi`: + *const T + *mut T + Box<[T]> + Box<[f32]> + Box<[f64]> + Box<[i16]> + Box<[i32]> + Box<[i64]> + and 35 others diff --git a/vendor/wasm-bindgen-macro/ui-tests/start-function.stderr b/vendor/wasm-bindgen-macro/ui-tests/start-function.stderr index aac6fccf0..9cd119761 100644 --- a/vendor/wasm-bindgen-macro/ui-tests/start-function.stderr +++ b/vendor/wasm-bindgen-macro/ui-tests/start-function.stderr @@ -11,61 +11,37 @@ error: the start function cannot have generics | ^^^ error[E0277]: the trait bound `Result<wasm_bindgen::JsValue, ()>: wasm_bindgen::__rt::Start` is not satisfied - --> ui-tests/start-function.rs:15:1 - | -15 | #[wasm_bindgen(start)] - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result<wasm_bindgen::JsValue, ()>` - | - = help: the following implementations were found: - <Result<(), E> as wasm_bindgen::__rt::Start> -note: required by `start` - --> $WORKSPACE/src/lib.rs - | - | fn start(self); - | ^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> ui-tests/start-function.rs:15:1 + | +15 | #[wasm_bindgen(start)] + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result<wasm_bindgen::JsValue, ()>` + | + = help: the trait `wasm_bindgen::__rt::Start` is implemented for `Result<(), E>` + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Result<wasm_bindgen::JsValue, wasm_bindgen::JsValue>: wasm_bindgen::__rt::Start` is not satisfied - --> ui-tests/start-function.rs:18:1 - | -18 | #[wasm_bindgen(start)] - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result<wasm_bindgen::JsValue, wasm_bindgen::JsValue>` - | - = help: the following implementations were found: - <Result<(), E> as wasm_bindgen::__rt::Start> -note: required by `start` - --> $WORKSPACE/src/lib.rs - | - | fn start(self); - | ^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> ui-tests/start-function.rs:18:1 + | +18 | #[wasm_bindgen(start)] + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result<wasm_bindgen::JsValue, wasm_bindgen::JsValue>` + | + = help: the trait `wasm_bindgen::__rt::Start` is implemented for `Result<(), E>` + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Result<wasm_bindgen::JsValue, ()>: wasm_bindgen::__rt::Start` is not satisfied - --> ui-tests/start-function.rs:27:1 - | -27 | #[wasm_bindgen(start)] - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result<wasm_bindgen::JsValue, ()>` - | - = help: the following implementations were found: - <Result<(), E> as wasm_bindgen::__rt::Start> -note: required by `start` - --> $WORKSPACE/src/lib.rs - | - | fn start(self); - | ^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> ui-tests/start-function.rs:27:1 + | +27 | #[wasm_bindgen(start)] + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result<wasm_bindgen::JsValue, ()>` + | + = help: the trait `wasm_bindgen::__rt::Start` is implemented for `Result<(), E>` + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Result<wasm_bindgen::JsValue, wasm_bindgen::JsValue>: wasm_bindgen::__rt::Start` is not satisfied - --> ui-tests/start-function.rs:30:1 - | -30 | #[wasm_bindgen(start)] - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result<wasm_bindgen::JsValue, wasm_bindgen::JsValue>` - | - = help: the following implementations were found: - <Result<(), E> as wasm_bindgen::__rt::Start> -note: required by `start` - --> $WORKSPACE/src/lib.rs - | - | fn start(self); - | ^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> ui-tests/start-function.rs:30:1 + | +30 | #[wasm_bindgen(start)] + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result<wasm_bindgen::JsValue, wasm_bindgen::JsValue>` + | + = help: the trait `wasm_bindgen::__rt::Start` is implemented for `Result<(), E>` + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/vendor/wasm-bindgen-macro/ui-tests/struct-fields.rs b/vendor/wasm-bindgen-macro/ui-tests/struct-fields.rs new file mode 100644 index 000000000..dee2c8934 --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/struct-fields.rs @@ -0,0 +1,15 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + pub type Foo; +} + +#[wasm_bindgen] +struct Bar { + pub a: Foo, + #[wasm_bindgen(getter_with_clone)] + pub b: Foo, +} + +fn main() {} diff --git a/vendor/wasm-bindgen-macro/ui-tests/struct-fields.stderr b/vendor/wasm-bindgen-macro/ui-tests/struct-fields.stderr new file mode 100644 index 000000000..ab1754695 --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/struct-fields.stderr @@ -0,0 +1,28 @@ +error[E0277]: the trait bound `Foo: std::marker::Copy` is not satisfied + --> ui-tests/struct-fields.rs:10:12 + | +10 | pub a: Foo, + | ^^^ the trait `std::marker::Copy` is not implemented for `Foo` + | +note: required by a bound in `__wbg_get_bar_a::assert_copy` + --> ui-tests/struct-fields.rs:8:1 + | +8 | #[wasm_bindgen] + | ^^^^^^^^^^^^^^^ required by this bound in `assert_copy` + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `Foo: Clone` is not satisfied + --> ui-tests/struct-fields.rs:11:20 + | +11 | #[wasm_bindgen(getter_with_clone)] + | ^---------------- + | | + | ____________________required by a bound introduced by this call + | | +12 | | pub b: Foo, + | |_________^ the trait `Clone` is not implemented for `Foo` + | +help: consider annotating `Foo` with `#[derive(Clone)]` + | +3 | #[derive(Clone)] + | diff --git a/vendor/wasm-bindgen-macro/ui-tests/traits-not-implemented.stderr b/vendor/wasm-bindgen-macro/ui-tests/traits-not-implemented.stderr index aaad988af..5b8e12228 100644 --- a/vendor/wasm-bindgen-macro/ui-tests/traits-not-implemented.stderr +++ b/vendor/wasm-bindgen-macro/ui-tests/traits-not-implemented.stderr @@ -4,15 +4,14 @@ error[E0277]: the trait bound `A: IntoWasmAbi` is not satisfied 5 | #[wasm_bindgen] | ^^^^^^^^^^^^^^^ the trait `IntoWasmAbi` is not implemented for `A` | -note: required by a bound in `IntoWasmAbi` - --> $WORKSPACE/src/convert/traits.rs - | - | / pub trait IntoWasmAbi: WasmDescribe { - | | /// The wasm ABI type that this converts into when crossing the ABI - | | /// boundary. - | | type Abi: WasmAbi; -... | - | | fn into_abi(self) -> Self::Abi; - | | } - | |_^ required by this bound in `IntoWasmAbi` + = help: the following other types implement trait `IntoWasmAbi`: + &'a (dyn Fn() -> R + 'b) + &'a (dyn Fn(A) -> R + 'b) + &'a (dyn Fn(A, B) -> R + 'b) + &'a (dyn Fn(A, B, C) -> R + 'b) + &'a (dyn Fn(A, B, C, D) -> R + 'b) + &'a (dyn Fn(A, B, C, D, E) -> R + 'b) + &'a (dyn Fn(A, B, C, D, E, F) -> R + 'b) + &'a (dyn Fn(A, B, C, D, E, F, G) -> R + 'b) + and 84 others = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/vendor/wasm-bindgen-macro/ui-tests/unknown-type-in-import.stderr b/vendor/wasm-bindgen-macro/ui-tests/unknown-type-in-import.stderr index e7bb64c53..af11dc2c6 100644 --- a/vendor/wasm-bindgen-macro/ui-tests/unknown-type-in-import.stderr +++ b/vendor/wasm-bindgen-macro/ui-tests/unknown-type-in-import.stderr @@ -1,7 +1,10 @@ error[E0412]: cannot find type `A` in this scope - --> $DIR/unknown-type-in-import.rs:6:19 + --> ui-tests/unknown-type-in-import.rs:6:19 | 6 | pub fn foo(a: A); - | - ^ not found in this scope - | | - | help: you might be missing a type parameter: `<A>` + | ^ not found in this scope + | +help: you might be missing a type parameter + | +6 | pub fn foo<A>(a: A); + | +++ diff --git a/vendor/wasm-bindgen-macro/ui-tests/unused-attributes.stderr b/vendor/wasm-bindgen-macro/ui-tests/unused-attributes.stderr index c4ba32f08..1df8f26a0 100644 --- a/vendor/wasm-bindgen-macro/ui-tests/unused-attributes.stderr +++ b/vendor/wasm-bindgen-macro/ui-tests/unused-attributes.stderr @@ -22,6 +22,12 @@ error: unused variable: `readonly` 21 | #[wasm_bindgen(readonly)] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_readonly` +error: unused variable: `typescript_type` + --> ui-tests/unused-attributes.rs:26:28 + | +26 | #[wasm_bindgen(getter, typescript_type = "Thing[]")] + | ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_typescript_type` + error: unused variable: `getter_with_clone` --> ui-tests/unused-attributes.rs:24:16 | @@ -33,9 +39,3 @@ error: unused variable: `final` | 24 | #[wasm_bindgen(getter_with_clone, final)] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_final` - -error: unused variable: `typescript_type` - --> ui-tests/unused-attributes.rs:26:28 - | -26 | #[wasm_bindgen(getter, typescript_type = "Thing[]")] - | ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_typescript_type` diff --git a/vendor/wasm-bindgen-macro/ui-tests/wasm-bindgen.rs b/vendor/wasm-bindgen-macro/ui-tests/wasm-bindgen.rs new file mode 100644 index 000000000..1675034a4 --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/wasm-bindgen.rs @@ -0,0 +1,43 @@ +extern crate wasm_bindgen as extern_test; + +use wasm_bindgen::prelude::*; + +mod test { + pub use wasm_bindgen as test; + pub use wasm_bindgen; +} + +#[wasm_bindgen(wasm_bindgen = wasm_bindgen)] +pub fn good1() {} + +#[wasm_bindgen(wasm_bindgen = ::wasm_bindgen)] +pub fn good2() {} + +#[wasm_bindgen(wasm_bindgen = test::wasm_bindgen)] +pub fn good3() {} + +#[wasm_bindgen(wasm_bindgen = test::test)] +pub fn good4() {} + +#[wasm_bindgen(wasm_bindgen = extern_test)] +pub fn good5() {} + +#[wasm_bindgen(wasm_bindgen_futures = wasm_bindgen_futures)] +pub fn good6() {} + +#[wasm_bindgen(wasm_bindgen = wasm_bindgen)] +pub async fn good7() {} + +#[wasm_bindgen(wasm_bindgen_futures = wasm_bindgen_futures)] +pub async fn good8() {} + +#[wasm_bindgen(wasm_bindgen = wasm_bindgen, wasm_bindgen_futures = wasm_bindgen_futures)] +pub async fn good9() {} + +#[wasm_bindgen(wasm_bindgen = test)] +pub fn bad1() {} + +#[wasm_bindgen(wasm_bindgen_futures = test)] +pub async fn bad2() {} + +fn main() {} diff --git a/vendor/wasm-bindgen-macro/ui-tests/wasm-bindgen.stderr b/vendor/wasm-bindgen-macro/ui-tests/wasm-bindgen.stderr new file mode 100644 index 000000000..7ed892ebb --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/wasm-bindgen.stderr @@ -0,0 +1,19 @@ +error[E0433]: failed to resolve: could not find `convert` in `test` + --> ui-tests/wasm-bindgen.rs:37:1 + | +37 | #[wasm_bindgen(wasm_bindgen = test)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not find `convert` in `test` + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0425]: cannot find function `future_to_promise` in module `test` + --> ui-tests/wasm-bindgen.rs:40:1 + | +40 | #[wasm_bindgen(wasm_bindgen_futures = test)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `test` + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider importing this function + | +3 | use wasm_bindgen_futures::future_to_promise; + | |