-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Rust][Diagnostics] Add initial boilerplate for Rust diagnostic interface. #6656
Conversation
cc @gussmith23 and @mwillsey |
Co-authored-by: Robert Kimball <[email protected]>
Co-authored-by: Robert Kimball <[email protected]>
I think this one is now ready to roll. |
Co-authored-by: Tristan Konolige <[email protected]>
rust/tvm-rt/src/array.rs
Outdated
|
||
fn next(&mut self) -> Option<Self::Item> { | ||
if self.pos < self.size { | ||
let item = self.array.get(self.pos).expect("should not fail"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though exceptional, better error message here than "should not fail"
} | ||
|
||
/// A mapping for all files in a source map to byte ranges. | ||
struct SpanToByteRange { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a place where we could integrating like tracing-style spans? (looking for PR ideas)
|
||
// TODO(@jroesch): define type | ||
type TypeData = ObjectRef; | ||
type GlobalTypeVar = ObjectRef; | ||
|
||
#[derive(Error, Debug)] | ||
pub enum Error { | ||
#[error("{0}")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also want to use #[source]
for the errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kind of stuff would be good follow up work imo.
…face. (apache#6656) * Add initial boilerplate for Rust diagnostic interface. * Codespan example almost working * WIP * Hacking on Rust inside of TVM * Borrow code from Egg * Update CMake and delete old API * Fix Linux build * Clean up exporting to show off new diagnostics * Improve Rust bindings * Fix calling * Fix * Rust Diagnostics work * Remove type checker * Format and cleanup * Fix the extension code * More cleanup * Fix some CR * Add docs and address feedback * WIP more improvments * Update cmake/modules/RustExt.cmake Co-authored-by: Robert Kimball <[email protected]> * Update rust/tvm/src/ir/diagnostics/mod.rs Co-authored-by: Robert Kimball <[email protected]> * Clean up PR * Format all * Remove dead comment * Code review comments and apache headers * Purge test file * Update cmake/modules/LLVM.cmake Co-authored-by: Tristan Konolige <[email protected]> * Format Rust * Add TK's suggestion * More CR and cleanup * Fix tyck line * Format Co-authored-by: Robert Kimball <[email protected]> Co-authored-by: Tristan Konolige <[email protected]>
…face. (apache#6656) * Add initial boilerplate for Rust diagnostic interface. * Codespan example almost working * WIP * Hacking on Rust inside of TVM * Borrow code from Egg * Update CMake and delete old API * Fix Linux build * Clean up exporting to show off new diagnostics * Improve Rust bindings * Fix calling * Fix * Rust Diagnostics work * Remove type checker * Format and cleanup * Fix the extension code * More cleanup * Fix some CR * Add docs and address feedback * WIP more improvments * Update cmake/modules/RustExt.cmake Co-authored-by: Robert Kimball <[email protected]> * Update rust/tvm/src/ir/diagnostics/mod.rs Co-authored-by: Robert Kimball <[email protected]> * Clean up PR * Format all * Remove dead comment * Code review comments and apache headers * Purge test file * Update cmake/modules/LLVM.cmake Co-authored-by: Tristan Konolige <[email protected]> * Format Rust * Add TK's suggestion * More CR and cleanup * Fix tyck line * Format Co-authored-by: Robert Kimball <[email protected]> Co-authored-by: Tristan Konolige <[email protected]>
…face. (apache#6656) * Add initial boilerplate for Rust diagnostic interface. * Codespan example almost working * WIP * Hacking on Rust inside of TVM * Borrow code from Egg * Update CMake and delete old API * Fix Linux build * Clean up exporting to show off new diagnostics * Improve Rust bindings * Fix calling * Fix * Rust Diagnostics work * Remove type checker * Format and cleanup * Fix the extension code * More cleanup * Fix some CR * Add docs and address feedback * WIP more improvments * Update cmake/modules/RustExt.cmake Co-authored-by: Robert Kimball <[email protected]> * Update rust/tvm/src/ir/diagnostics/mod.rs Co-authored-by: Robert Kimball <[email protected]> * Clean up PR * Format all * Remove dead comment * Code review comments and apache headers * Purge test file * Update cmake/modules/LLVM.cmake Co-authored-by: Tristan Konolige <[email protected]> * Format Rust * Add TK's suggestion * More CR and cleanup * Fix tyck line * Format Co-authored-by: Robert Kimball <[email protected]> Co-authored-by: Tristan Konolige <[email protected]>
This PR exposes new diagnostics to Rust so we can reuse the better libraries for diagnostics rendering via Rust.