mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-21 12:40:52 +00:00
* Make ConvertToAst trait fallible It's got some panics, and we'll be switching those to errors! * First example of a diagnostic-driven error Add a diagnostic-driven error `#[wasm_bindgen]` being attached to public functions, and add some macros to boot to make it easier to generate errors! * Result-ify `src/parser.rs` This commit converts all of `src/parser.rs` away from panics to using `Diagnostic` instead. Along the way this adds a test case per changed `panic!`, ensuring that we don't regress in these areas!
33 lines
796 B
Plaintext
33 lines
796 B
Plaintext
error: error parsing #[wasm_bindgen] attribute options: failed to parse anything
|
|
--> $DIR/invalid-attr.rs:7:16
|
|
|
|
|
7 | #[wasm_bindgen(x)]
|
|
| ^
|
|
|
|
error: error parsing #[wasm_bindgen] attribute options: failed to parse anything
|
|
--> $DIR/invalid-attr.rs:12:20
|
|
|
|
|
12 | #[wasm_bindgen(y)]
|
|
| ^
|
|
|
|
error: malformed #[wasm_bindgen] attribute
|
|
--> $DIR/invalid-attr.rs:15:5
|
|
|
|
|
15 | #[wasm_bindgen z]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
error: malformed #[wasm_bindgen] attribute
|
|
--> $DIR/invalid-attr.rs:18:5
|
|
|
|
|
18 | #[wasm_bindgen(z2) x]
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: malformed #[wasm_bindgen] attribute
|
|
--> $DIR/invalid-attr.rs:21:5
|
|
|
|
|
21 | #[wasm_bindgen { }]
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 5 previous errors
|
|
|