wasm-bindgen/crates/macro/ui-tests/invalid-attr.stderr
Alex Crichton bdec2582aa
Result-ify src/parser.rs (#608)
* 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!
2018-08-01 18:59:59 -05:00

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