# rust-diagnostics [![](https://img.shields.io/crates/v/rust-diagnostics.svg)](https://crates.io/crates/rust-diagnostics) This is a utility to insert diagnostics of code fragments as comments in Rust code and checks how a warning/error in the diagnostics has been fixed in git commit history. Rust compiler displays many diagnostics to the console, using file name and line numbers to indicate their exact locations. Without an IDE, it requires a programmer to go back and forth between command console and the editor. This utility inserts the diagnostic messages in-place, which could enable transformer-based machine learning approaches to analyse Rust diagnostic semantics. Through additional arguments, this utility also checks how a warning found in revision r1 has been manually fixed by a revision r2. Currently we integrate the utility with `clippy` and `git2-rs`. ## Installation ```bash cargo install rust-diagnostics ``` ## Usage: The full synoposis of the command is shown below. ```bash rust-diagnostics [--patch [--confirm] [--pair] [--function] [--single] [--location] [--mixed] ] ``` ### A running example To illustrate its usage, we use a small example, let's call it an `abc` project. ```bash rm -rf abc cargo init --bin abc cat > abc/src/main.rs < src/main.rs < src/main.rs <