Skip to content

Commit 4dc8f4f

Browse files
authored
Fix the resolution for the core module (#4606)
1 parent 81f86cb commit 4dc8f4f

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
* Fix running coverage with no_modules.
6868
[#4604](https://github.com/wasm-bindgen/wasm-bindgen/pull/4604)
6969

70+
* Fix proc-macro hygiene with `core`.
71+
[#4606](https://github.com/wasm-bindgen/wasm-bindgen/pull/4606)
72+
7073
--------------------------------------------------------------------------------
7174

7275
## [0.2.100](https://github.com/wasm-bindgen/wasm-bindgen/compare/0.2.99...0.2.100)

crates/backend/src/codegen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ impl ToTokens for ast::ImportType {
11681168
if !no_deref {
11691169
(quote! {
11701170
#[automatically_derived]
1171-
impl core::ops::Deref for #rust_name {
1171+
impl #wasm_bindgen::__rt::core::ops::Deref for #rust_name {
11721172
type Target = #internal_obj;
11731173

11741174
#[inline]

tests/resolve_core_module.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
mod core {}
2+
3+
#[wasm_bindgen_macro::wasm_bindgen]
4+
extern "C" {
5+
type Foo;
6+
}

0 commit comments

Comments
 (0)