fitzgen opened Issue #2204:
pretty_error
should be replaced with methods onCodegenError
that mutate the error and provide the context thatpretty_error
otherwise adds, and theCodegenError
'sDisplay
impl should print whatpretty_error
creates when it has the necessary context.These context-adding methods would be similar to how the
wast
crate adds file contents and filename context to errors with these methods:
- https://docs.rs/wast/24.0.0/wast/struct.Error.html#method.set_text
- https://docs.rs/wast/24.0.0/wast/struct.Error.html#method.set_path
Then we can delete
pretty_error
, and avoid using string as an error type in more places (notably incranelift-filetests
and itspretty_anyhow_error
workaround).
fitzgen labeled Issue #2204:
pretty_error
should be replaced with methods onCodegenError
that mutate the error and provide the context thatpretty_error
otherwise adds, and theCodegenError
'sDisplay
impl should print whatpretty_error
creates when it has the necessary context.These context-adding methods would be similar to how the
wast
crate adds file contents and filename context to errors with these methods:
- https://docs.rs/wast/24.0.0/wast/struct.Error.html#method.set_text
- https://docs.rs/wast/24.0.0/wast/struct.Error.html#method.set_path
Then we can delete
pretty_error
, and avoid using string as an error type in more places (notably incranelift-filetests
and itspretty_anyhow_error
workaround).
fitzgen labeled Issue #2204:
pretty_error
should be replaced with methods onCodegenError
that mutate the error and provide the context thatpretty_error
otherwise adds, and theCodegenError
'sDisplay
impl should print whatpretty_error
creates when it has the necessary context.These context-adding methods would be similar to how the
wast
crate adds file contents and filename context to errors with these methods:
- https://docs.rs/wast/24.0.0/wast/struct.Error.html#method.set_text
- https://docs.rs/wast/24.0.0/wast/struct.Error.html#method.set_path
Then we can delete
pretty_error
, and avoid using string as an error type in more places (notably incranelift-filetests
and itspretty_anyhow_error
workaround).
github-actions[bot] commented on Issue #2204:
Subscribe to Label Action
cc @bnjbvr
<details>
This issue or pull request has been labeled: "cranelift"Thus the following users have been cc'd because of the following labels:
- bnjbvr: cranelift
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
bjorn3 commented on Issue #2204:
pretty_error
takes a reference toisa
andfunc
. Doing this would requireCodegenError
to borrow from them.
fitzgen commented on Issue #2204:
The idea is to take copies of the data gathered from those things and store them into the error, rather than borrow those things.
bjorn3 commented on Issue #2204:
pretty_error
needs the entire function, as the error shows the full function source. From the target isa it needs the register_info and encoding_info.
taegyunkim commented on Issue #2204:
I'd like to take this issue. Is anyone looking into this?
fitzgen commented on Issue #2204:
It's all you @taegyunkim!
Last updated: Dec 23 2024 at 12:05 UTC