Skip to content

Commit 3c41e2a

Browse files
committed
Fix Rust edition 2024 compatibility
1 parent 1d4965c commit 3c41e2a

File tree

5 files changed

+18
-2
lines changed

5 files changed

+18
-2
lines changed

crates/backend/src/codegen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,9 +1894,9 @@ fn respan(input: TokenStream, span: &dyn ToTokens) -> TokenStream {
18941894

18951895
for (i, token) in spans.into_iter().enumerate() {
18961896
if i == 0 {
1897-
first_span = token.span();
1897+
first_span = Span::call_site().located_at(token.span());
18981898
}
1899-
last_span = token.span();
1899+
last_span = Span::call_site().located_at(token.span());
19001900
}
19011901

19021902
let mut new_tokens = Vec::new();

crates/macro/ui-tests/missing-catch.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
error[E0277]: the trait bound `Result<wasm_bindgen::JsValue, wasm_bindgen::JsValue>: FromWasmAbi` is not satisfied
22
--> ui-tests/missing-catch.rs:6:9
33
|
4+
3 | #[wasm_bindgen]
5+
| --------------- in this procedural macro expansion
6+
...
47
6 | pub fn foo() -> Result<JsValue, JsValue>;
58
| ^^^ the trait `FromWasmAbi` is not implemented for `Result<wasm_bindgen::JsValue, wasm_bindgen::JsValue>`
69
|
@@ -14,3 +17,4 @@ error[E0277]: the trait bound `Result<wasm_bindgen::JsValue, wasm_bindgen::JsVal
1417
i64
1518
usize
1619
and $N others
20+
= note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

crates/macro/ui-tests/pub-not-copy.stderr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
error[E0277]: the trait bound `String: std::marker::Copy` is not satisfied
22
--> $DIR/pub-not-copy.rs:5:16
33
|
4+
3 | #[wasm_bindgen]
5+
| --------------- in this procedural macro expansion
6+
4 | pub struct A {
47
5 | pub field: String,
58
| ^^^^^^ the trait `std::marker::Copy` is not implemented for `String`
69
|

crates/macro/ui-tests/struct-fields.stderr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
error[E0277]: the trait bound `Foo: std::marker::Copy` is not satisfied
22
--> ui-tests/struct-fields.rs:10:12
33
|
4+
8 | #[wasm_bindgen]
5+
| --------------- in this procedural macro expansion
6+
9 | struct Bar {
47
10 | pub a: Foo,
58
| ^^^ the trait `std::marker::Copy` is not implemented for `Foo`
69
|

crates/macro/ui-tests/unknown-type-in-import.stderr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ help: you might be missing a type parameter
88
|
99
6 | pub fn foo<A>(a: A);
1010
| +++
11+
12+
error[E0412]: cannot find type `A` in this scope
13+
--> ui-tests/unknown-type-in-import.rs:6:19
14+
|
15+
6 | pub fn foo(a: A);
16+
| ^ not found in this scope

0 commit comments

Comments
 (0)