From cfce93ec645627dba4c0f1782411c1810c739ff5 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Wed, 21 Feb 2024 15:29:23 +0100 Subject: [PATCH] Update Rust version for UI tests --- .github/workflows/main.yml | 2 +- crates/macro/ui-tests/async-errors.stderr | 44 +++++++++---------- crates/macro/ui-tests/missing-catch.stderr | 16 +++---- crates/macro/ui-tests/start-function.stderr | 28 +++++------- crates/macro/ui-tests/struct-fields.stderr | 14 +++--- .../ui-tests/traits-not-implemented.stderr | 16 +++---- crates/macro/ui-tests/wasm-bindgen.stderr | 8 +++- crates/test-macro/ui-tests/crate.stderr | 5 +++ 8 files changed, 66 insertions(+), 67 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b2851321610..0157c230edc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -246,7 +246,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - run: rustup update --no-self-update 1.69.0 && rustup default 1.69.0 + - run: rustup update --no-self-update 1.76.0 && rustup default 1.76.0 - run: cargo test -p wasm-bindgen-macro - run: cargo test -p wasm-bindgen-test-macro diff --git a/crates/macro/ui-tests/async-errors.stderr b/crates/macro/ui-tests/async-errors.stderr index a128c73c090..5526851f1d3 100644 --- a/crates/macro/ui-tests/async-errors.stderr +++ b/crates/macro/ui-tests/async-errors.stderr @@ -1,52 +1,48 @@ error[E0277]: the trait bound `Result<(), ()>: IntoJsResult` is not satisfied - --> ui-tests/async-errors.rs:30:1 + --> ui-tests/async-errors.rs:31:24 | -30 | #[wasm_bindgen] - | ^^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result<(), ()>` +31 | pub async fn bad1() -> Result<(), ()> { loop {} } + | ^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result<(), ()>` | = help: the following other types implement trait `IntoJsResult`: Result<(), E> Result - = 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 + --> ui-tests/async-errors.rs:33:24 | -32 | #[wasm_bindgen] - | ^^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result<(), BadType>` +33 | pub async fn bad2() -> Result<(), BadType> { loop {} } + | ^^^^^^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result<(), BadType>` | = help: the following other types implement trait `IntoJsResult`: Result<(), E> Result - = 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` is not satisfied - --> ui-tests/async-errors.rs:34:1 + --> ui-tests/async-errors.rs:35:24 | -34 | #[wasm_bindgen] - | ^^^^^^^^^^^^^^^ the trait `From` is not implemented for `wasm_bindgen::JsValue` +35 | pub async fn bad3() -> BadType { loop {} } + | ^^^^^^^ the trait `From` is not implemented for `wasm_bindgen::JsValue` | = help: the following other types implement trait `From`: - > - > - > - > - > - > - > - > + > + > + > + > + > + > + > + > and $N others = note: required for `BadType` to implement `Into` = 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: IntoJsResult` is not satisfied - --> ui-tests/async-errors.rs:36:1 + --> ui-tests/async-errors.rs:37:24 | -36 | #[wasm_bindgen] - | ^^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result` +37 | pub async fn bad4() -> Result { loop {} } + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result` | = help: the following other types implement trait `IntoJsResult`: Result<(), E> Result - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/macro/ui-tests/missing-catch.stderr b/crates/macro/ui-tests/missing-catch.stderr index 5e54e41e7f7..02a74e62f00 100644 --- a/crates/macro/ui-tests/missing-catch.stderr +++ b/crates/macro/ui-tests/missing-catch.stderr @@ -5,12 +5,12 @@ error[E0277]: the trait bound `Result` | = help: the following other types implement trait `FromWasmAbi`: - *const T - *mut T - Box<[T]> - Clamped - Option - Option - Option - Option + bool + char + isize + i8 + i16 + i32 + i64 + usize and $N others diff --git a/crates/macro/ui-tests/start-function.stderr b/crates/macro/ui-tests/start-function.stderr index 9cd11976118..cc25189ba49 100644 --- a/crates/macro/ui-tests/start-function.stderr +++ b/crates/macro/ui-tests/start-function.stderr @@ -11,37 +11,33 @@ error: the start function cannot have generics | ^^^ error[E0277]: the trait bound `Result: wasm_bindgen::__rt::Start` is not satisfied - --> ui-tests/start-function.rs:15:1 + --> ui-tests/start-function.rs:16:14 | -15 | #[wasm_bindgen(start)] - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` +16 | fn foo5() -> Result { Err(()) } + | ^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` | = 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::__rt::Start` is not satisfied - --> ui-tests/start-function.rs:18:1 + --> ui-tests/start-function.rs:19:14 | -18 | #[wasm_bindgen(start)] - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` +19 | fn foo6() -> Result { Ok(JsValue::from(1u32)) } + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` | = 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::__rt::Start` is not satisfied - --> ui-tests/start-function.rs:27:1 + --> ui-tests/start-function.rs:28:26 | -27 | #[wasm_bindgen(start)] - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` +28 | async fn foo_async3() -> Result { Err(()) } + | ^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` | = 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::__rt::Start` is not satisfied - --> ui-tests/start-function.rs:30:1 + --> ui-tests/start-function.rs:31:26 | -30 | #[wasm_bindgen(start)] - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` +31 | async fn foo_async4() -> Result { Ok(JsValue::from(1u32)) } + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` | = 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/crates/macro/ui-tests/struct-fields.stderr b/crates/macro/ui-tests/struct-fields.stderr index ab17546955e..6e402b2d6ab 100644 --- a/crates/macro/ui-tests/struct-fields.stderr +++ b/crates/macro/ui-tests/struct-fields.stderr @@ -12,17 +12,13 @@ note: required by a bound in `__wbg_get_bar_a::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 + --> ui-tests/struct-fields.rs:12:12 | -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` +12 | pub b: Foo, + | ^^^ the trait `Clone` is not implemented for `Foo` | help: consider annotating `Foo` with `#[derive(Clone)]` | -3 | #[derive(Clone)] +3 + #[derive(Clone)] +4 | #[wasm_bindgen] | diff --git a/crates/macro/ui-tests/traits-not-implemented.stderr b/crates/macro/ui-tests/traits-not-implemented.stderr index 714050a53b5..883648fae4c 100644 --- a/crates/macro/ui-tests/traits-not-implemented.stderr +++ b/crates/macro/ui-tests/traits-not-implemented.stderr @@ -5,13 +5,13 @@ error[E0277]: the trait bound `A: IntoWasmAbi` is not satisfied | ^^^^^^^^^^^^^^^ the trait `IntoWasmAbi` is not implemented for `A` | = 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) + bool + char + isize + i8 + i16 + i32 + i64 + usize and $N 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/crates/macro/ui-tests/wasm-bindgen.stderr b/crates/macro/ui-tests/wasm-bindgen.stderr index 7ed892ebb0a..2ec13836be6 100644 --- a/crates/macro/ui-tests/wasm-bindgen.stderr +++ b/crates/macro/ui-tests/wasm-bindgen.stderr @@ -5,6 +5,12 @@ error[E0433]: failed to resolve: could not find `convert` in `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) +help: consider importing one of these items + | +3 + use crate::test::test::convert; + | +3 + use wasm_bindgen::convert; + | error[E0425]: cannot find function `future_to_promise` in module `test` --> ui-tests/wasm-bindgen.rs:40:1 @@ -15,5 +21,5 @@ error[E0425]: cannot find function `future_to_promise` in module `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; +3 + use wasm_bindgen_futures::future_to_promise; | diff --git a/crates/test-macro/ui-tests/crate.stderr b/crates/test-macro/ui-tests/crate.stderr index 2bace352ee4..e256cb3f4fe 100644 --- a/crates/test-macro/ui-tests/crate.stderr +++ b/crates/test-macro/ui-tests/crate.stderr @@ -3,3 +3,8 @@ error[E0433]: failed to resolve: use of undeclared crate or module `foo` | 17 | #[wasm_bindgen_test(crate = foo)] | ^^^ use of undeclared crate or module `foo` + | +help: consider importing this module + | +5 + use wasm_bindgen_test::__rt; + |