Improve diagnostics with missing trait implementations

Rejigger a few spans, work around an odd rustc issue, and hopefully
produce higher quality error messages!

Closes #1528
This commit is contained in:
Alex Crichton
2019-05-20 10:49:06 -07:00
parent a02d210d5c
commit 2cbb8b8a69
6 changed files with 68 additions and 9 deletions

View File

@ -1,7 +1,7 @@
error[E0277]: the trait bound `std::result::Result<wasm_bindgen::JsValue, wasm_bindgen::JsValue>: wasm_bindgen::convert::traits::FromWasmAbi` is not satisfied
--> $DIR/missing-catch.rs:3:1
--> $DIR/missing-catch.rs:6:9
|
3 | #[wasm_bindgen]
| ^^^^^^^^^^^^^^^ the trait `wasm_bindgen::convert::traits::FromWasmAbi` is not implemented for `std::result::Result<wasm_bindgen::JsValue, wasm_bindgen::JsValue>`
6 | pub fn foo() -> Result<JsValue, JsValue>;
| ^^^ the trait `wasm_bindgen::convert::traits::FromWasmAbi` is not implemented for `std::result::Result<wasm_bindgen::JsValue, wasm_bindgen::JsValue>`
For more information about this error, try `rustc --explain E0277`.