Improve error messages using annotate-snippets#2036
Improve error messages using annotate-snippets#2036Kixunil wants to merge 1 commit intocreusot-rs:masterfrom
Conversation
Whenever a VC failed to prove, the user would have to launch the why3 IDE and click through to find the line where the proof failed. This was quite annoying. It's preferable to have error messages similar to what rustc/cargo emit so that the location is immediately visible. This change uses the why3 OCaml API to inspect the failures and prints them out in the same style rustc uses using the `annotate-snippets` crate (which is the crate that `rustc` currently uses internally).
|
To be honest, I don't think we can merge this in the current state:
I'm really sorry for that. |
Oh, crap, sorry, I didn't mean to commit those parts, that was a mistake. I saw some missing spans and tried to add them and submit a PR separately but that work is not finished yet. Yeah, it's garbage because I didn't understand it so I tried to brute-force it with an LLM as a stopgap for the tool to work with the intention to come back and clean it up. It seems I mistyped some git command and included it. I'm very sorry to have taken your review time on that crap. Regarding the linking part, did I misunderstand this message? #2012 (comment) Or did you hope the integration would be simpler which turned out to not be the case? In any case, I plan to maintain it as a separate binary for myself so we can merge it later when the situation changes. |
Sorry for me not being precise in #2012 (comment): I did mean that we could have an OCaml process linking with the Why3/Why3find APIs which would somehow communicate with another process written in Rust. I did not imagine that you would figure out a way to use the Rust-OCaml FFI, write stubs and have a working build system for that. |
|
Ah, I see, that would've made so much sense. I guess I could try that. The stub already does some kind of serialization, so it should be fairly easy to just move to another process. |
WIP The code contained a bunch of unsound
unsafewhich I've fixed here but I think some things are still off. At least some spams look weird and there's an unknown VC, so I will need to categorize it.Whenever a VC failed to prove, the user would have to launch the why3 IDE and click through to find the line where the proof failed. This was quite annoying. It's preferable to have error messages similar to what rustc/cargo emit so that the location is immediately visible.
This change uses the why3 OCaml API to inspect the failures and prints them out in the same style rustc uses using the
annotate-snippetscrate (which is the crate thatrustccurrently uses internally).Closes #2012