diff options
Diffstat (limited to 'vendor/wasm-bindgen-macro')
-rw-r--r-- | vendor/wasm-bindgen-macro/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/wasm-bindgen-macro/Cargo.toml | 11 | ||||
-rw-r--r-- | vendor/wasm-bindgen-macro/src/lib.rs | 29 | ||||
-rw-r--r-- | vendor/wasm-bindgen-macro/src/worker.js | 1 | ||||
-rw-r--r-- | vendor/wasm-bindgen-macro/ui-tests/async-errors.stderr | 114 | ||||
-rw-r--r-- | vendor/wasm-bindgen-macro/ui-tests/link-to.rs | 32 | ||||
-rw-r--r-- | vendor/wasm-bindgen-macro/ui-tests/link-to.stderr | 31 | ||||
-rw-r--r-- | vendor/wasm-bindgen-macro/ui-tests/missing-catch.stderr | 30 | ||||
-rw-r--r-- | vendor/wasm-bindgen-macro/ui-tests/start-function.rs | 20 | ||||
-rw-r--r-- | vendor/wasm-bindgen-macro/ui-tests/start-function.stderr | 12 | ||||
-rw-r--r-- | vendor/wasm-bindgen-macro/ui-tests/traits-not-implemented.stderr | 32 |
11 files changed, 205 insertions, 109 deletions
diff --git a/vendor/wasm-bindgen-macro/.cargo-checksum.json b/vendor/wasm-bindgen-macro/.cargo-checksum.json index b28610651..6c78e5167 100644 --- a/vendor/wasm-bindgen-macro/.cargo-checksum.json +++ b/vendor/wasm-bindgen-macro/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"377c6fe534700370a86f95dffbd82e3cad703a69286dd927afac58bc8b9afc57","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"ef5ffff199bf75993b81c3c1de8dbe19babb22b89170763323fa11a85c62f045","src/lib.rs":"2b63b3cf46acde23d9822773c231c110ffa1edf9697e308c90d2eb1bb41464f4","tests/ui.rs":"aed1b0f4e8c99b06657c54f3a74de4b3535ce567fb20e4d2fc6911b361c3d934","ui-tests/async-errors.rs":"f3ab249b3741b38c6213651a5cd36f8b9873bad34bd49d13b780d21bed47272b","ui-tests/async-errors.stderr":"68a547c3b7107c0ddcab4f15729752dee3af781203126daa3b350f2047093faf","ui-tests/attribute-fails-to-parse.rs":"c21c2a250534ca7e80fc462804efc0db8a71b6b0cdb0c57c5cab444d081f68de","ui-tests/attribute-fails-to-parse.stderr":"3bc77befbbe7e2d0744dd81067a75cb70c3f2d8bd9c60ec5bcb2dfb65fc1a593","ui-tests/bad-signatures.rs":"96b53e9327cc75747510b548b97cff86429532d5cdf65cc991211bca5646abc2","ui-tests/bad-signatures.stderr":"931e934ccbc43e4cee41a46ecaa3953c3ccdef69450519a838b9af428f75fa72","ui-tests/import-local.rs":"783ef9ebb792111ec7fd335cbc4f684381609c86c0af660fd5ab35cf04cacbf4","ui-tests/import-local.stderr":"6e90ad05c3783d7c69ff4e156458c63ee45ceb7ea8ebc38e1ca52e7f46e8bcf8","ui-tests/invalid-attr.rs":"603cf0bcb95a42a35e535a7d9577dc8c5e6175af4cd27d83fdf77cd6b67acf48","ui-tests/invalid-attr.stderr":"e1fd9450e16f1d672cb708bcbaf99a07f916c48d3e961c1dd1e92bd835d3ec53","ui-tests/invalid-enums.rs":"bf473e1bbafbcde82c946311e824d97bd1f941cfc5c1495025d8a7a513b90a19","ui-tests/invalid-enums.stderr":"ecd549ab69e7d7d645922857e2a83b7171f97a276afeb9f113407a4181b2b9e2","ui-tests/invalid-imports.rs":"452e9df87229ebea5442f384b0bd27a2c082d731a3b99fc7617e9a583392cf3a","ui-tests/invalid-imports.stderr":"4f59f109ec9d5acacf5f22f1467dca7d81e6dbabde95e7bd025ef330c275774a","ui-tests/invalid-items.rs":"ca919f7fe6c0d9fd4218ec43c85d7b43f478ed3042959479eb42adc23f4edf02","ui-tests/invalid-items.stderr":"a7392f1b918cac6eda3cefa5244dc555e4b6332836cab0bbd341b992672cd064","ui-tests/invalid-methods.rs":"c463bee9962d936ef2aeb4051ebc5558c0b7fefe6e459f3a325482763746969f","ui-tests/invalid-methods.stderr":"9666dcd88bc3824b7f7e75093f16a298cb3ba726cc67bc7bd70d698648201fe4","ui-tests/invalid-setter.rs":"db9666df889b58246a51ebc7d753e41ac4382475257a589499a4e886e6fbc45f","ui-tests/invalid-setter.stderr":"d1629836ec39727bfa4737538e9f991cda6fbaeb1c0f8c878cb13757e66daac5","ui-tests/missing-catch.rs":"705bf784db641b30131510b5c47192014e19aeeeb6f73ede1d5356ad2c29915c","ui-tests/missing-catch.stderr":"c51f9c535cfadc603f23fad5e96bb22d7733f0d063c0b365ae5f4a97e84c8ef1","ui-tests/non-public-function.rs":"0fe075b32c211870bcde0f7dce0eceaffb61a4f8a6ffbd90946a59d7d220343c","ui-tests/non-public-function.stderr":"c9f6f5123b6c3462b8952d6e468ed13c566635d4939b98c9098d2a713f5aa2df","ui-tests/pub-not-copy.rs":"1e50f0b63a6e6363b0926cf947b0492a9803ddb35370f32e733a32506df9b556","ui-tests/pub-not-copy.stderr":"1090980d08622552b82c13da82b4c26ce309314b6062f0c5443a65eff5255d00","ui-tests/start-function.rs":"479cb4389545ccf7c155677fe629c135e3374a3f622aab3c17a4db63abca1a55","ui-tests/start-function.stderr":"36b0ca2c38742bb6b999d8d1c302229c5b6176afedd73c3fc4a9da57c480613a","ui-tests/structural-and-final.rs":"1571b078a9d0be6c96ab97be10f1bf369dbb740f04fa312834f49a64130f8d30","ui-tests/structural-and-final.stderr":"cf21dec2851d3f667b93a317ba9e4657a623c49e8b779ea64669452297ba0a17","ui-tests/traits-not-implemented.rs":"3445e15b9c61f84a1f8d703a3a4fe2d2e2d85960ff6b2ac718644d97bf1564e1","ui-tests/traits-not-implemented.stderr":"cb291d21f427a1beee469cc32ea8704d58415272ac52f5b90c76c4f2bb823679","ui-tests/unknown-type-in-import.rs":"7fbc95bb82d0d60568b8daf27236418219c57447d1dc2e2e384e5f907bac3e3e","ui-tests/unknown-type-in-import.stderr":"2d213673be2dfcb6b56b9efacea9e968c5ae4faab9fabd6c5c66495008d5fe20","ui-tests/unused-attributes.rs":"7c20441c30e53376c9e72fcf82da0cc6e7462eec3087f9eb74f9682eaf7fb3e6","ui-tests/unused-attributes.stderr":"d4557e356289d0775d29b64797079c623e6d7db1ce319ee59cafb0de6d6a32eb","ui-tests/update-all-references.sh":"8b8dbf31e7ada1314956db7a20ab14b13af3ae246a6295afdc7dc96af8ec3773","ui-tests/update-references.sh":"65375c25981646e08e8589449a06be4505b1a2c9e10d35f650be4b1b495dff22"},"package":"052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810"}
\ No newline at end of file +{"files":{"Cargo.toml":"9be0ee1f3cbfb997ad380ad079fe3e50224229512ddfc35dfb70e2682e0c5b13","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"ef5ffff199bf75993b81c3c1de8dbe19babb22b89170763323fa11a85c62f045","src/lib.rs":"8ba70e362eeb15efaf686df366c3525c24272d61141e31585e1f642b030a54c9","src/worker.js":"cb5c33dd41cfad622abce5464a3ceae478904ea16ddc3c6c769ee33e0c086692","tests/ui.rs":"aed1b0f4e8c99b06657c54f3a74de4b3535ce567fb20e4d2fc6911b361c3d934","ui-tests/async-errors.rs":"f3ab249b3741b38c6213651a5cd36f8b9873bad34bd49d13b780d21bed47272b","ui-tests/async-errors.stderr":"bbfc704c145bfd69d993f2ac6890b89df1e1a3a1c24fde1fc824164a69ffefaf","ui-tests/attribute-fails-to-parse.rs":"c21c2a250534ca7e80fc462804efc0db8a71b6b0cdb0c57c5cab444d081f68de","ui-tests/attribute-fails-to-parse.stderr":"3bc77befbbe7e2d0744dd81067a75cb70c3f2d8bd9c60ec5bcb2dfb65fc1a593","ui-tests/bad-signatures.rs":"96b53e9327cc75747510b548b97cff86429532d5cdf65cc991211bca5646abc2","ui-tests/bad-signatures.stderr":"931e934ccbc43e4cee41a46ecaa3953c3ccdef69450519a838b9af428f75fa72","ui-tests/import-local.rs":"783ef9ebb792111ec7fd335cbc4f684381609c86c0af660fd5ab35cf04cacbf4","ui-tests/import-local.stderr":"6e90ad05c3783d7c69ff4e156458c63ee45ceb7ea8ebc38e1ca52e7f46e8bcf8","ui-tests/invalid-attr.rs":"603cf0bcb95a42a35e535a7d9577dc8c5e6175af4cd27d83fdf77cd6b67acf48","ui-tests/invalid-attr.stderr":"e1fd9450e16f1d672cb708bcbaf99a07f916c48d3e961c1dd1e92bd835d3ec53","ui-tests/invalid-enums.rs":"bf473e1bbafbcde82c946311e824d97bd1f941cfc5c1495025d8a7a513b90a19","ui-tests/invalid-enums.stderr":"ecd549ab69e7d7d645922857e2a83b7171f97a276afeb9f113407a4181b2b9e2","ui-tests/invalid-imports.rs":"452e9df87229ebea5442f384b0bd27a2c082d731a3b99fc7617e9a583392cf3a","ui-tests/invalid-imports.stderr":"4f59f109ec9d5acacf5f22f1467dca7d81e6dbabde95e7bd025ef330c275774a","ui-tests/invalid-items.rs":"ca919f7fe6c0d9fd4218ec43c85d7b43f478ed3042959479eb42adc23f4edf02","ui-tests/invalid-items.stderr":"a7392f1b918cac6eda3cefa5244dc555e4b6332836cab0bbd341b992672cd064","ui-tests/invalid-methods.rs":"c463bee9962d936ef2aeb4051ebc5558c0b7fefe6e459f3a325482763746969f","ui-tests/invalid-methods.stderr":"9666dcd88bc3824b7f7e75093f16a298cb3ba726cc67bc7bd70d698648201fe4","ui-tests/invalid-setter.rs":"db9666df889b58246a51ebc7d753e41ac4382475257a589499a4e886e6fbc45f","ui-tests/invalid-setter.stderr":"d1629836ec39727bfa4737538e9f991cda6fbaeb1c0f8c878cb13757e66daac5","ui-tests/link-to.rs":"be7003f80bf05cffa1301d049bd8f3792513a3f3922da3e74f4b58086970bb85","ui-tests/link-to.stderr":"c582600658db54acf3c16ffde723320a4cbcca3514cc30659badb524a06f66e7","ui-tests/missing-catch.rs":"705bf784db641b30131510b5c47192014e19aeeeb6f73ede1d5356ad2c29915c","ui-tests/missing-catch.stderr":"b67a2a6e2d49bb36eb3078ce06c7c7475e20fcb041a668ed2dac549a7f7ba03c","ui-tests/non-public-function.rs":"0fe075b32c211870bcde0f7dce0eceaffb61a4f8a6ffbd90946a59d7d220343c","ui-tests/non-public-function.stderr":"c9f6f5123b6c3462b8952d6e468ed13c566635d4939b98c9098d2a713f5aa2df","ui-tests/pub-not-copy.rs":"1e50f0b63a6e6363b0926cf947b0492a9803ddb35370f32e733a32506df9b556","ui-tests/pub-not-copy.stderr":"1090980d08622552b82c13da82b4c26ce309314b6062f0c5443a65eff5255d00","ui-tests/start-function.rs":"a56f1309182e597370555c18aa31e240e70e82585d6e72ab4c42e2229a8c1a53","ui-tests/start-function.stderr":"391a244fd07e94372bbd963e46b2e50133e976fc5c3ff1ebfb48126d6aa45f9f","ui-tests/structural-and-final.rs":"1571b078a9d0be6c96ab97be10f1bf369dbb740f04fa312834f49a64130f8d30","ui-tests/structural-and-final.stderr":"cf21dec2851d3f667b93a317ba9e4657a623c49e8b779ea64669452297ba0a17","ui-tests/traits-not-implemented.rs":"3445e15b9c61f84a1f8d703a3a4fe2d2e2d85960ff6b2ac718644d97bf1564e1","ui-tests/traits-not-implemented.stderr":"f1c2fce2efac88c2b1bc23a30d77cb64dc73a9fcb2ceb1ecf926f7ed9b739e48","ui-tests/unknown-type-in-import.rs":"7fbc95bb82d0d60568b8daf27236418219c57447d1dc2e2e384e5f907bac3e3e","ui-tests/unknown-type-in-import.stderr":"2d213673be2dfcb6b56b9efacea9e968c5ae4faab9fabd6c5c66495008d5fe20","ui-tests/unused-attributes.rs":"7c20441c30e53376c9e72fcf82da0cc6e7462eec3087f9eb74f9682eaf7fb3e6","ui-tests/unused-attributes.stderr":"d4557e356289d0775d29b64797079c623e6d7db1ce319ee59cafb0de6d6a32eb","ui-tests/update-all-references.sh":"8b8dbf31e7ada1314956db7a20ab14b13af3ae246a6295afdc7dc96af8ec3773","ui-tests/update-references.sh":"65375c25981646e08e8589449a06be4505b1a2c9e10d35f650be4b1b495dff22"},"package":"4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5"}
\ No newline at end of file diff --git a/vendor/wasm-bindgen-macro/Cargo.toml b/vendor/wasm-bindgen-macro/Cargo.toml index 99d0e52a5..9bdda78c4 100644 --- a/vendor/wasm-bindgen-macro/Cargo.toml +++ b/vendor/wasm-bindgen-macro/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.84" authors = ["The wasm-bindgen Developers"] description = """ Definition of the `#[wasm_bindgen]` attribute, an internal dependency @@ -30,16 +30,19 @@ proc-macro = true version = "1.0" [dependencies.wasm-bindgen-macro-support] -version = "=0.2.83" +version = "=0.2.84" [dev-dependencies.trybuild] version = "1.0" [dev-dependencies.wasm-bindgen] -version = "0.2.83" +version = "0.2.84" [dev-dependencies.wasm-bindgen-futures] -version = "0.4.33" +version = "0.4.34" + +[dev-dependencies.web-sys] +version = "0.3.61" [features] spans = ["wasm-bindgen-macro-support/spans"] diff --git a/vendor/wasm-bindgen-macro/src/lib.rs b/vendor/wasm-bindgen-macro/src/lib.rs index c677aaf24..fbae81875 100644 --- a/vendor/wasm-bindgen-macro/src/lib.rs +++ b/vendor/wasm-bindgen-macro/src/lib.rs @@ -18,6 +18,35 @@ pub fn wasm_bindgen(attr: TokenStream, input: TokenStream) -> TokenStream { } } +/// This macro takes a JS module as input and returns a URL that can be used to +/// access it at runtime. +/// +/// The module can be specified in a few ways: +/// - You can use `inline_js = "..."` to create an inline JS file. +/// - You can use `module = "/foo/bar"` to reference a file relative to the +/// root of the crate the macro is invoked in. +/// +/// The returned URL can be used for things like creating workers/worklets: +/// ```no_run +/// use web_sys::Worker; +/// let worker = Worker::new(&wasm_bindgen::link_to!(module = "/src/worker.js")); +/// ``` +#[proc_macro] +pub fn link_to(input: TokenStream) -> TokenStream { + match wasm_bindgen_macro_support::expand_link_to(input.into()) { + Ok(tokens) => { + if cfg!(feature = "xxx_debug_only_print_generated_code") { + println!("{}", tokens); + } + tokens.into() + } + // This `String::clone` is here so that IDEs know this is supposed to be a + // `String` and can keep type-checking the rest of the program even if the macro + // fails. + Err(diagnostic) => (quote! { String::clone(#diagnostic) }).into(), + } +} + #[proc_macro_attribute] pub fn __wasm_bindgen_class_marker(attr: TokenStream, input: TokenStream) -> TokenStream { match wasm_bindgen_macro_support::expand_class_marker(attr.into(), input.into()) { diff --git a/vendor/wasm-bindgen-macro/src/worker.js b/vendor/wasm-bindgen-macro/src/worker.js new file mode 100644 index 000000000..360d4d429 --- /dev/null +++ b/vendor/wasm-bindgen-macro/src/worker.js @@ -0,0 +1 @@ +// This file is needed for the doctest of `crate::link_to`. diff --git a/vendor/wasm-bindgen-macro/ui-tests/async-errors.stderr b/vendor/wasm-bindgen-macro/ui-tests/async-errors.stderr index 492492a18..c1fec077d 100644 --- a/vendor/wasm-bindgen-macro/ui-tests/async-errors.stderr +++ b/vendor/wasm-bindgen-macro/ui-tests/async-errors.stderr @@ -1,68 +1,68 @@ error[E0277]: the trait bound `Result<(), ()>: IntoJsResult` is not satisfied - --> ui-tests/async-errors.rs:30:1 - | -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> + --> ui-tests/async-errors.rs:30:1 + | +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>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $WORKSPACE/src/lib.rs + | + | fn into_js_result(self) -> Result<JsValue, JsValue>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = 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 - --> ui-tests/async-errors.rs:32:1 - | -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> + --> ui-tests/async-errors.rs:32:1 + | +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>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $WORKSPACE/src/lib.rs + | + | fn into_js_result(self) -> Result<JsValue, JsValue>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = 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 - --> ui-tests/async-errors.rs:34:1 - | -34 | #[wasm_bindgen] - | ^^^^^^^^^^^^^^^ the trait `From<BadType>` is not implemented for `wasm_bindgen::JsValue` - | - = help: the following implementations were found: - <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<JsError>> - and 73 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` + --> ui-tests/async-errors.rs:34:1 + | +34 | #[wasm_bindgen] + | ^^^^^^^^^^^^^^^ the trait `From<BadType>` is not implemented for `wasm_bindgen::JsValue` + | + = help: the following implementations were found: + <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>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $WORKSPACE/src/lib.rs + | + | fn into_js_result(self) -> Result<JsValue, JsValue>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = 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 - --> ui-tests/async-errors.rs:36:1 - | -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> + --> ui-tests/async-errors.rs:36:1 + | +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>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $WORKSPACE/src/lib.rs + | + | fn into_js_result(self) -> Result<JsValue, JsValue>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = 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/link-to.rs b/vendor/wasm-bindgen-macro/ui-tests/link-to.rs new file mode 100644 index 000000000..ce51c128e --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/link-to.rs @@ -0,0 +1,32 @@ +fn good1() -> String { + wasm_bindgen::link_to!(inline_js = "console.log('Hello world!');") +} + +fn good2() -> String { + wasm_bindgen::link_to!(raw_module = "./foo.js") +} + +fn bad1() -> String { + wasm_bindgen::link_to!(module = "package/foo.js") +} + +fn bad2() -> String { + wasm_bindgen::link_to!(raw_module = "package/foo.js") +} + +fn bad3() -> String { + wasm_bindgen::link_to!(module = "/src/not-found.js") +} + +fn bad4() -> String { + wasm_bindgen::link_to!() +} + +fn bad5() -> String { + wasm_bindgen::link_to!( + inline_js = "console.log('Hello world!');", + js_namespace = foo + ) +} + +fn main() {} diff --git a/vendor/wasm-bindgen-macro/ui-tests/link-to.stderr b/vendor/wasm-bindgen-macro/ui-tests/link-to.stderr new file mode 100644 index 000000000..61aaec783 --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/link-to.stderr @@ -0,0 +1,31 @@ +error: `link_to!` does not support module paths. + --> ui-tests/link-to.rs:10:37 + | +10 | wasm_bindgen::link_to!(module = "package/foo.js") + | ^^^^^^^^^^^^^^^^ + +error: `link_to!` does not support module paths. + --> ui-tests/link-to.rs:14:41 + | +14 | wasm_bindgen::link_to!(raw_module = "package/foo.js") + | ^^^^^^^^^^^^^^^^ + +error: failed to read file `$WORKSPACE/target/tests/trybuild/wasm-bindgen-macro/src/not-found.js`: No such file or directory (os error 2) + --> ui-tests/link-to.rs:18:37 + | +18 | wasm_bindgen::link_to!(module = "/src/not-found.js") + | ^^^^^^^^^^^^^^^^^^^ + +error: `link_to!` requires a module. + --> ui-tests/link-to.rs:22:5 + | +22 | wasm_bindgen::link_to!() + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in the macro `wasm_bindgen::link_to` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: unused wasm_bindgen attribute + --> ui-tests/link-to.rs:28:9 + | +28 | js_namespace = foo + | ^^^^^^^^^^^^ diff --git a/vendor/wasm-bindgen-macro/ui-tests/missing-catch.stderr b/vendor/wasm-bindgen-macro/ui-tests/missing-catch.stderr index 4c20dbe76..d08553b1b 100644 --- a/vendor/wasm-bindgen-macro/ui-tests/missing-catch.stderr +++ b/vendor/wasm-bindgen-macro/ui-tests/missing-catch.stderr @@ -1,17 +1,17 @@ error[E0277]: the trait bound `Result<wasm_bindgen::JsValue, wasm_bindgen::JsValue>: FromWasmAbi` is not satisfied - --> $DIR/missing-catch.rs:6:9 - | -6 | pub fn foo() -> Result<JsValue, JsValue>; - | ^^^ the trait `FromWasmAbi` is not implemented for `Result<wasm_bindgen::JsValue, wasm_bindgen::JsValue>` - | + --> ui-tests/missing-catch.rs:6:9 + | +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` - --> $DIR/traits.rs:23:1 - | -23 | / pub trait FromWasmAbi: WasmDescribe { -24 | | /// The wasm ABI type that this converts from when coming back out from the -25 | | /// ABI boundary. -26 | | type Abi: WasmAbi; -... | -35 | | unsafe fn from_abi(js: Self::Abi) -> Self; -36 | | } - | |_^ required by this 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` diff --git a/vendor/wasm-bindgen-macro/ui-tests/start-function.rs b/vendor/wasm-bindgen-macro/ui-tests/start-function.rs index 65ad90bf2..6bc94c3be 100644 --- a/vendor/wasm-bindgen-macro/ui-tests/start-function.rs +++ b/vendor/wasm-bindgen-macro/ui-tests/start-function.rs @@ -1,33 +1,33 @@ use wasm_bindgen::prelude::*; #[wasm_bindgen(start)] -pub fn foo() {} +fn foo() {} #[wasm_bindgen(start)] -pub fn foo2(x: u32) {} +fn foo2(x: u32) {} #[wasm_bindgen(start)] -pub fn foo3<T>() {} +fn foo3<T>() {} #[wasm_bindgen(start)] -pub fn foo4() -> Result<(), JsValue> { Ok(()) } +fn foo4() -> Result<(), JsValue> { Ok(()) } #[wasm_bindgen(start)] -pub fn foo5() -> Result<JsValue, ()> { Err(()) } +fn foo5() -> Result<JsValue, ()> { Err(()) } #[wasm_bindgen(start)] -pub fn foo6() -> Result<JsValue, JsValue> { Ok(JsValue::from(1u32)) } +fn foo6() -> Result<JsValue, JsValue> { Ok(JsValue::from(1u32)) } #[wasm_bindgen(start)] -pub async fn foo_async1() {} +async fn foo_async1() {} #[wasm_bindgen(start)] -pub async fn foo_async2() -> Result<(), JsValue> { Ok(()) } +async fn foo_async2() -> Result<(), JsValue> { Ok(()) } #[wasm_bindgen(start)] -pub async fn foo_async3() -> Result<JsValue, ()> { Err(()) } +async fn foo_async3() -> Result<JsValue, ()> { Err(()) } #[wasm_bindgen(start)] -pub async fn foo_async4() -> Result<JsValue, JsValue> { Ok(JsValue::from(1u32)) } +async fn foo_async4() -> Result<JsValue, JsValue> { Ok(JsValue::from(1u32)) } fn main() {} diff --git a/vendor/wasm-bindgen-macro/ui-tests/start-function.stderr b/vendor/wasm-bindgen-macro/ui-tests/start-function.stderr index 8f459863d..aac6fccf0 100644 --- a/vendor/wasm-bindgen-macro/ui-tests/start-function.stderr +++ b/vendor/wasm-bindgen-macro/ui-tests/start-function.stderr @@ -1,14 +1,14 @@ error: the start function cannot have arguments - --> ui-tests/start-function.rs:7:13 + --> ui-tests/start-function.rs:7:9 | -7 | pub fn foo2(x: u32) {} - | ^^^^^^ +7 | fn foo2(x: u32) {} + | ^^^^^^ error: the start function cannot have generics - --> ui-tests/start-function.rs:10:12 + --> ui-tests/start-function.rs:10:8 | -10 | pub fn foo3<T>() {} - | ^^^ +10 | fn foo3<T>() {} + | ^^^ error[E0277]: the trait bound `Result<wasm_bindgen::JsValue, ()>: wasm_bindgen::__rt::Start` is not satisfied --> ui-tests/start-function.rs:15:1 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 7b0f90f57..aaad988af 100644 --- a/vendor/wasm-bindgen-macro/ui-tests/traits-not-implemented.stderr +++ b/vendor/wasm-bindgen-macro/ui-tests/traits-not-implemented.stderr @@ -1,18 +1,18 @@ error[E0277]: the trait bound `A: IntoWasmAbi` is not satisfied - --> $DIR/traits-not-implemented.rs:5:1 - | -5 | #[wasm_bindgen] - | ^^^^^^^^^^^^^^^ the trait `IntoWasmAbi` is not implemented for `A` - | + --> ui-tests/traits-not-implemented.rs:5:1 + | +5 | #[wasm_bindgen] + | ^^^^^^^^^^^^^^^ the trait `IntoWasmAbi` is not implemented for `A` + | note: required by a bound in `IntoWasmAbi` - --> $DIR/traits.rs:9:1 - | -9 | / pub trait IntoWasmAbi: WasmDescribe { -10 | | /// The wasm ABI type that this converts into when crossing the ABI -11 | | /// boundary. -12 | | type Abi: WasmAbi; -... | -16 | | fn into_abi(self) -> Self::Abi; -17 | | } - | |_^ required by this bound in `IntoWasmAbi` - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $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` + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) |