diff --git a/crates/test-macro/src/lib.rs b/crates/test-macro/src/lib.rs index fbde05846d9..848ffaf25dc 100644 --- a/crates/test-macro/src/lib.rs +++ b/crates/test-macro/src/lib.rs @@ -76,9 +76,11 @@ pub fn wasm_bindgen_test( let mut tokens = Vec::::new(); let should_panic = match should_panic { - Some(Some(lit)) => quote! { Some(Some(#lit)) }, - Some(None) => quote! { Some(None) }, - None => quote! { None }, + Some(Some(lit)) => { + quote! { ::core::option::Option::Some(::core::option::Option::Some(#lit)) } + } + Some(None) => quote! { ::core::option::Option::Some(::core::option::Option::None) }, + None => quote! { ::core::option::Option::None }, }; let test_body = if r#async { diff --git a/crates/test-macro/ui-tests/should_panic.rs b/crates/test-macro/ui-tests/should_panic.rs index 0357a423dd7..d3399050e88 100644 --- a/crates/test-macro/ui-tests/should_panic.rs +++ b/crates/test-macro/ui-tests/should_panic.rs @@ -1,3 +1,7 @@ +#![no_implicit_prelude] + +extern crate wasm_bindgen_test_macro; + use wasm_bindgen_test_macro::wasm_bindgen_test; #[wasm_bindgen_test] diff --git a/crates/test-macro/ui-tests/should_panic.stderr b/crates/test-macro/ui-tests/should_panic.stderr index d5e0467fdda..9436970aec1 100644 --- a/crates/test-macro/ui-tests/should_panic.stderr +++ b/crates/test-macro/ui-tests/should_panic.stderr @@ -1,59 +1,59 @@ error: malformed `#[should_panic = "..."]` attribute - --> ui-tests/should_panic.rs:28:15 + --> ui-tests/should_panic.rs:32:15 | -28 | #[should_panic::error] +32 | #[should_panic::error] | ^ error: malformed `#[should_panic]` attribute - --> ui-tests/should_panic.rs:32:18 + --> ui-tests/should_panic.rs:36:18 | -32 | #[should_panic = 42] +36 | #[should_panic = 42] | ^^ error: malformed `#[should_panic = "..."]` attribute - --> ui-tests/should_panic.rs:36:15 + --> ui-tests/should_panic.rs:40:15 | -36 | #[should_panic[]] +40 | #[should_panic[]] | ^^ error: malformed `#[should_panic(...)]` attribute - --> ui-tests/should_panic.rs:40:15 + --> ui-tests/should_panic.rs:44:15 | -40 | #[should_panic(42)] +44 | #[should_panic(42)] | ^^^^ error: malformed `#[should_panic(...)]` attribute - --> ui-tests/should_panic.rs:44:15 + --> ui-tests/should_panic.rs:48:15 | -44 | #[should_panic(test)] +48 | #[should_panic(test)] | ^^^^^^ error: malformed `#[should_panic(...)]` attribute - --> ui-tests/should_panic.rs:48:15 + --> ui-tests/should_panic.rs:52:15 | -48 | #[should_panic(expected)] +52 | #[should_panic(expected)] | ^^^^^^^^^^ error: malformed `#[should_panic(...)]` attribute - --> ui-tests/should_panic.rs:52:15 + --> ui-tests/should_panic.rs:56:15 | -52 | #[should_panic(expected::error)] +56 | #[should_panic(expected::error)] | ^^^^^^^^^^^^^^^^^ error: malformed `#[should_panic]` attribute - --> ui-tests/should_panic.rs:56:3 + --> ui-tests/should_panic.rs:60:3 | -56 | #[should_panic(expected =)] +60 | #[should_panic(expected =)] | ^^^^^^^^^^^^ error: malformed `#[should_panic]` attribute - --> ui-tests/should_panic.rs:60:27 + --> ui-tests/should_panic.rs:64:27 | -60 | #[should_panic(expected = 5)] +64 | #[should_panic(expected = 5)] | ^ error: duplicate `should_panic` attribute - --> ui-tests/should_panic.rs:65:3 + --> ui-tests/should_panic.rs:69:3 | -65 | #[should_panic = "test"] +69 | #[should_panic = "test"] | ^^^^^^^^^^^^