rust-diagnostics

This is a utility to insert diagnostics of code fragments as comments in Rust code. Rust compiler produces many diagnostic information to the console, using file name and line numbers to indicate the exact location. However, that requires a programmer to go back and forth between the command console and an editor. This utility would make it easier to insert the diagnostic messages in place, similar to the idea of 'in-place' editing concept. The diagnostic information added into the code sequence could enable further transformer-based machine learning approaches to analyse the semantics of Rust programas.

Currently we integrate it with clippy.

Installation

bash cargo install rust-diagnostics

Usage:

bash warning

The commented code will be generated from the Rust code.

Note that this is a result of applying the utilility on its own implementation, i.e., eating our own dog food. We have manually resolved all the clippy warnings according to the specified clippy rules, except for the one on dbg_macro to show the results as an example:

```rust /#[Warning(clippy::dbg_macro)/dbg!(&r)/*

[Warning(clippy::dbg_macro)

note: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#dbgmacro the lint level is defined here ensure to avoid having uses of it in version control*/; `` contains aWarningas the diagnostic code, andclippy::dbgmacroas the name of the lint rule violated by the codedbg!(&msg)`.

Update

Acknowledgement