Pssst!... see what Rust is doing behind the curtains πŸ•΅πŸ€«

Overview

cargo-inspect

Logo

docs Build Status

What is Rust doing behind the scenes?

There are only two ways to live your life.
One is as though nothing is a miracle. The other is as though everything is a miracle. -- Albert Einstein

Installation

You need Rust nightly and rustfmt to get started.
You can install those via rustup:

rustup install nightly
rustup component add rustfmt

All set? Let's get cracking!

cargo install cargo-inspect

Usage

Call it on any Rust file:

cargo inspect main.rs

If you don't specify a file, the current crate will be analyzed instead.

cargo inspect

Depending on the size of the crate, this might take a while.
Please be patient.

It can also compare two file outputs! Try this:

cargo inspect --diff examples/range.rs,examples/range_inclusive.rs --plain

Configuration

USAGE:
    cargo inspect [FLAGS] [OPTIONS] [INPUT_FILE]

FLAGS:
    -h, --help
            Prints help information

        --list-themes
            Should we list all pretty printer themes?

        --plain
            Don't highlight output

    -V, --version
            Prints version information

    -v, --verbose
            Print the original code as a comment above the desugared code


OPTIONS:
        --theme <THEME>
            Specify a theme override for the pretty printer

        --diff <files>
            Diff input files

        --format <format>
            Override for the format that gets outputted when the `unpretty` mode is set to `flowgraph` [default: svg]

        --unpretty <unpretty>
            rustc "unpretty" parameters

            *Note*: For `--unpretty=flowgraph=[symbol]` you need to have `dot` on your PATH. [default: hir]

ARGS:
    <INPUT_FILE>
            Input file

Background

Rust allows for a lot of syntactic sugar, that makes it a pleasure to write. It is sometimes hard, however, to look behind the curtain and see what the compiler is really doing with our code.

To quote @tshepang, "It is good to know what these conveniences are, to avoid being mystified by what's going on under the hood... the less magical thinking we have of the world, the better."

  • lifetime elisions
  • type inference
  • syntactic sugar
  • implicit dereferencing
  • type coercions
  • hidden code (e.g. the prelude)

I was always interested in how programming languages work in the background, how my code was unrolled to make the compiler backend easier to maintain.

The goal is to make the compiler more approachable for mere mortals.
Mystery! Exploration! Discovery!

Read more on the background of cargo-inspect on my blog.

Code Examples

If-let gets desugared into match

Consider the following code snippet:

fn main() {
    if let Some(x) = Some(1) {
        // Do something with x
    }
}

When you compile it, the first thing Rust does is desugar it. To see what the code looks like after this step, run

cargo inspect examples/if_let.rs

This produces the following output:

Please run the command to reproduce the desugared output

You can see that the if let was desugared into a match statement.

To change the colorscheme, try cargo-inspect --list-themes, e.g.

cargo inspect examples/if_let.rs --theme GitHub

Please run the command to reproduce the desugared output

Oh, and if you have graphviz installed, you can also print a pretty flowgraph from your code:

cargo inspect --unpretty=flowgraph=main examples/if_let.rs

Please run the command to reproduce the desugared output

More examples

Please find more examples in the examples folder. You can also contribute more.

The Magic Sauce

The best things in the world are assembled from simple building blocks. This tool stands on the shoulders of giants. To work its magic, it runs the following commands:

  1. rustc -Zinspect=hir, for retrieving the HIR.
  2. rustfmt, for formatting the output.
  3. prettyprint, for syntax-highlighting, which is just a wrapper around the awesome syntect and bat crates.

Contributing

This is a young project, which has downsides and upsides.

  • Everything is in flux and things can break at any time. 😫
  • There's plenty of opportunity to shape and form the project. 😊

Thus, become a contributor today!

Known issues

As of now, this is a very fragile tool. If it fails, it might will produce horrible output. You have been warned. That said, it won't eat your code, of course. 😊

License

Licensed under either of

at your option.

Credits

Magnifying glass designed by Rawpixel.com

Comments
  • cannot inspect async code

    cannot inspect async code

    hello.

    Cargo.toml

    [package]
    name = "async-programming"
    version = "0.1.0"
    edition = "2021"
    
    [dependencies]
    tokio = { workspace = true, features = ["full"] }
    futures = { workspace = true }
    

    main.rs

    // use futures::executor::block_on;
    use tokio::runtime::{Runtime, Builder as RuntimeBuilder};
    use tokio::time::sleep as asleep;
    use tokio::join as ajoin;
    use std::time::Duration;
    
    async fn task_function(task_name: &str) -> usize {
        let mut sum = 0usize;
        println!("start!");
        for index in 0..10 {
            asleep(Duration::from_secs_f32(0.5)).await;
            println!("{task_name}: {index}");
            sum += index;
        }
        println!("stop!");
        sum
    }
    
    async fn async_main() {
        let task1 = task_function("task-1");
        let task2 = task_function("task-2");
        // task1.await;
        // task2.await;
        let (r1, r2) = ajoin!(task1, task2);
    }
    
    fn main() {
        let rt = RuntimeBuilder::new_multi_thread()
            // this is for the async sleep
            .enable_time()
            .worker_threads(1)
            .thread_name("main-workter")
            .thread_stack_size(3 * 1024 * 1024)
            .build()
            .unwrap();
        rt.block_on(async_main());
    }
    

    the error

    ❱  cargo inspect examples/simple.rs
    Command failed:
    error[E0670]: `async fn` is not permitted in Rust 2015
     --> examples/simple.rs:7:1
      |
    7 | async fn task_function(task_name: &str) -> usize {
      | ^^^^^ to use `async fn`, switch to Rust 2018 or later
      |
      = help: set `edition = "2021"` in `Cargo.toml`
      = note: for more on editions, read https://doc.rust-lang.org/edition-guide
    
    error[E0670]: `async fn` is not permitted in Rust 2015
      --> examples/simple.rs:19:1
       |
    19 | async fn async_main() {
       | ^^^^^ to use `async fn`, switch to Rust 2018 or later
       |
       = help: set `edition = "2021"` in `Cargo.toml`
       = note: for more on editions, read https://doc.rust-lang.org/edition-guide
    
    error[E0433]: failed to resolve: maybe a missing crate `tokio`?
     --> examples/simple.rs:2:5
      |
    2 | use tokio::runtime::{Runtime, Builder as RuntimeBuilder};
      |     ^^^^^ maybe a missing crate `tokio`?
      |
      = help: consider adding `extern crate tokio` to use the `tokio` crate
    
    error[E0433]: failed to resolve: maybe a missing crate `tokio`?
     --> examples/simple.rs:3:5
      |
    3 | use tokio::time::sleep as asleep;
      |     ^^^^^ maybe a missing crate `tokio`?
      |
      = help: consider adding `extern crate tokio` to use the `tokio` crate
    
    error[E0432]: unresolved import `tokio`
     --> examples/simple.rs:4:5
      |
    4 | use tokio::join as ajoin;
      |     ^^^^^ maybe a missing crate `tokio`?
      |
      = help: consider adding `extern crate tokio` to use the `tokio` crate
    
    error: cannot determine resolution for the macro `ajoin`
      --> examples/simple.rs:24:20
       |
    24 |     let (r1, r2) = ajoin!(task1, task2);
       |                    ^^^^^
       |
       = note: import resolution is stuck, try simplifying macro imports
    

    any ideas? thanks in advance.

    opened by alexzanderr 11
  • Installation fails while building a dep `onig_sys v69.5.0`

    Installation fails while building a dep `onig_sys v69.5.0`

    This is the traceback I get while cargo installing this crate

       Compiling darling_macro v0.9.0
    error: failed to run custom build command for `onig_sys v69.5.0`
    
    Caused by:
      process didn't exit successfully: `/tmp/cargo-installedrsNz/release/build/onig_sys-1e6f2f943c42c112/build-script-build` (exit code: 101)
    --- stdout
    cargo:warning=couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
    cargo:warning=set the LLVM_CONFIG_PATH environment variable to the full path to a valid `llvm-config` executable (including the executable itself)
    
    --- stderr
    thread 'main' panicked at 'Unable to find libclang: "couldn\'t find any valid shared libraries matching: [\'libclang.so\', \'libclang-*.so\', \'libclang.so.*\', \'libclang-*.so.*\'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"', /home/palash25/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.53.3/src/lib.rs:1956:13
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    warning: build failed, waiting for other jobs to finish...
    error: failed to compile `cargo-inspect v0.10.0`, intermediate artifacts can be found at `/tmp/cargo-installedrsNz`
    
    Caused by:
      build failed
    

    Looks like that onig_sys needs llvm and clang to be able to build maybe it should be mentioned in the README to have these installed as a pre-requisite?

    opened by palash25 11
  • Change the default output for a flowgraph to a vector format

    Change the default output for a flowgraph to a vector format

    After some thinking I realised rendering flowgraphs to pngs is nice but imposes problems with big graphs.

    dot also allows rendering to a vector format (svg). This PR changes the default format to svg.

    Maybe this can be extended to allow a choice through a command line parameter for the user to choose in what format to render?

    opened by jonathansty 6
  • Support graphviz/dot files

    Support graphviz/dot files

    As discussed in #26 , this PR adds the ability to render out a flowgraph to a file.

    When --unpretty=flowgraph=[symbol] is used we pass the unformatted output through dot. For this to work dot has to be in the PATH though.

    opened by jonathansty 6
  • Implement theme override argument

    Implement theme override argument

    Fixes #17

    Allow the user to specify a theme override for the pretty printer. If the theme doesn't exist pretty printer outputs a warning.

    @mre I do not know what themes are available. I had a look in pretty printer and the only theme I can deduce (from the source) is the default one. The other themes are stored in a binary format. Is there some list of the available themes to test this PR with?

    opened by jonathansty 4
  • Write an IntelliJ plugin for cargo-inspect

    Write an IntelliJ plugin for cargo-inspect

    Similar to cargo-inspect-vscode, it would be nice to have a plugin to run cargo-inspect from IntelliJ. I never wrote an IntelliJ plugin, but if somebody wants to tackle that, here would be the starting point in the official plugin documentation.

    help wanted good first issue stale 
    opened by mre 4
  • Is this tool working?

    Is this tool working?

    Hi! This looks like a useful tool. Is it expected to work?

    I ask because, on current stable/nightly, it prints nothing. Specifically,

    [cbiffle@coyote elfinject-rs]$ cargo inspect
    ─────┬───────────────────────────────────────────────────────────────────────────────────
         β”‚ /home/cbiffle/proj/elfinject-rs
    ─────┼───────────────────────────────────────────────────────────────────────────────────
       1 β”‚ 
    ─────┴───────────────────────────────────────────────────────────────────────────────────
    [cbiffle@coyote elfinject-rs]$
    

    bin crates, lib crates, host crates, cross-compiled crates, workspaces, no workspaces -- they all look like that. (Tested on 1.49 stable and a recent nightly.)

    I had assumed the crate was not abandoned because of recent commits, but it looks like all commits since ~August are from a bot.

    stale 
    opened by cbiffle 3
  • Show memory dropping

    Show memory dropping

    I'd like cargo-inspect to show when rustc drops memory (and probably injects calls to std::mem::drop or something similar).

    Happy to support tackling this, although I'd need some guidance 😸

    stale 
    opened by Urhengulas 3
  • Const Function Evaluation

    Const Function Evaluation

    I've enjoyed using cargo inspect to help debug during procedural macro development but I was wondering if it would be possible to make it capable of showing the compile time execution of const functions. I believe this execution happens at the MIR level instead of the HIR level.

    The reason I ask is I have a project I'm working on right now where the goal is to compile a builder pattern down to its built output when all of the parameters are known at compile time. I need a tool to prove that it is actually happening though.

    stale 
    opened by chuck-flowers 3
  • Fix issue with structopt

    Fix issue with structopt

    In #31, our lovely dependabot tried to update structopt. The CI pipeline failed however. Here is the relevant snippet:

    error: `parse` argument must be a function path
    
      --> src/config.rs:28:53
    
       |
    
    28 |     #[structopt(long = "diff", parse(try_from_str = "parse_tuple"))]
    
       |                                                     ^^^^^^^^^^^^^
    
    warning: trait objects without an explicit `dyn` are deprecated
    
     --> src/config.rs:5:50
    
      |
    
    5 | fn parse_tuple<T>(s: &str) -> Result<(T, T), Box<Error>>
    
      |                                                  ^^^^^ help: use `dyn`: `dyn Error`
    
      |
    
      = note: `#[warn(bare_trait_objects)]` on by default
    
    error[E0599]: no function or associated item named `augment_clap` found for type `config::Config` in the current scope
    
      --> src/config.rs:67:12
    
       |
    
    22 | pub struct Config {
    
       | ----------------- function or associated item `augment_clap` not found for this
    
    ...
    
    67 |     Config(Config),
    
       |            ^^^^^^ function or associated item not found in `config::Config`
    
    error[E0599]: no function or associated item named `is_subcommand` found for type `config::Config` in the current scope
    
      --> src/config.rs:67:12
    
       |
    
    22 | pub struct Config {
    
       | ----------------- function or associated item `is_subcommand` not found for this
    
    ...
    
    67 |     Config(Config),
    
       |            ^^^^^^ function or associated item not found in `config::Config`
    
    error: aborting due to 3 previous errors
    

    I think the main problem is this: 28 | #[structopt(long = "diff", parse(try_from_str = "parse_tuple"))]

    Probably the syntax changed a bit. If someone wants to tackle that, please go ahead and create a PR. 😊

    help wanted good first issue dependencies hacktoberfest stale 
    opened by mre 3
  • Support graphviz/dot files

    Support graphviz/dot files

    rustc supports graphviz/dot output using the flowgraph flag (see @jonathansty's post here):

    rustc +nightly -Zunpretty=flowgraph=main foo.rs
    

    This can already be triggered with cargo-inspect:

    cargo inspect --unpretty=flowgraph=main
    

    Unfortunately, this is just syntax-highlighting the dot-file itself and not showing a pretty graph. It would be nice to have an option like cargo inspect --graph, which renders the dot file as a graph in a new window or as an ASCII representation. We would have to do some research to find a crate which allows this. Help wanted. :)

    help wanted good first issue 
    opened by mre 3
  • Bump indicatif from 0.15.0 to 0.17.2

    Bump indicatif from 0.15.0 to 0.17.2

    Bumps indicatif from 0.15.0 to 0.17.2.

    Release notes

    Sourced from indicatif's releases.

    0.17.2

    A small maintenance release which makes indicatif more portable and fixes some minor regressions.

    On behalf of @​djc and @​chris-laplante, thanks to all contributors!

    0.17.1

    2.5 months after the large 0.17 release, we (finally) have a release that addresses most of the regressions found in 0.17. There is ongoing work on changes in the estimation algorithm, tracked in #394, which has regressed for some users.

    Note that we made some technically semver-breaking change of adding a missing Sync bound to the ProgressTracker bounds (#471). We're assuming that most users don't (yet) have custom ProgressTracker impls, and that users who do have probably built one that is Sync anyway.

    Fixed regressions

    • Fixed unicode-width feature spelling (#456)
    • Only tick if the ticker is disabled (#458)
    • Rework MultiProgress zombie line handling (#460)
    • Fix incorrect link in documentation (#469, thanks to @​Jedsek)
    • Take a reference for ProgressBar::style() (#476, thanks to @​andrewchambers)

    Other changes

    Thanks from @​djc and @​chris-laplante to all contributors!

    0.17.0

    indicatif is one of the most popular terminal progress bar libraries in the Rust ecosystem. More than a year after the 0.16.0 release, we're happy to finally release 0.17. In the past year, the indicatif team has grown to two maintainers, since @​chris-laplante joined @​djc as a maintainer. We also now have a Discord channel.

    Apart from many small API additions and fixes, particular effort has gone into reducing the overhead for reporting progress. To this end, we've removed some of the explicit rate limiting APIs in favor of a single refresh rate in the ProgressDrawTarget. We now set a rate limit by default (50ms) that should drastically reduce overhead for most applications while being more than enough for most terminal applications. Additionally, position updates are now synchronized by using atomic integer APIs instead of a mutex. In a basic test the simplest possible progress bar is about 95x faster on 0.17.0 compared to 0.16.2.

    We've made many changes to the way MultiProgress collections work. You no longer need to explicitly join() the MultiProgress, there are more ways to insert new progress bars into the collection, and many correctness improvements have been made, in part to more effort having gone into testing the crate.

    Additionally, we've reduced our dependency footprint, removing lazy_static and regex from our required dependencies.

    Additions

    ... (truncated)

    Commits
    • 25afbed Bump version number to 0.17.2
    • 8e220fd Fix clippy lints
    • 5b8b905 Fix percent initial value when there is no length
    • 2c85ff8 Add an armv5te test job to CI
    • 44ec391 Use portable-atomic to fix build on some 32-bit platforms
    • 14b5ef2 Update test to ensure reset occurs after rewind
    • 997567d Reset estimator of progress rate on backwards movement
    • 517398b Bump MSRV to 1.56
    • 222df5b Add additional tests for multi-progress multiline rendering
    • be579da Improve multiline support in format_style
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump env_logger from 0.9.1 to 0.10.0

    Bump env_logger from 0.9.1 to 0.10.0

    Bumps env_logger from 0.9.1 to 0.10.0.

    Release notes

    Sourced from env_logger's releases.

    v0.9.3

    Fix a regression from v0.9.2 where env_logger would fail to compile with the termcolor feature turned off.

    v0.9.2

    Fix and un-deprecate Target::Pipe, which was basically not working at all before and deprecated in 0.9.1.

    Changelog

    Sourced from env_logger's changelog.

    0.10.0 - 2022-11-24

    MSRV changed to 1.60 to hide optional dependencies

    Fixes

    • Resolved soundness issue by switching from atty to is-terminal

    Breaking Changes

    To open room for changing dependencies:

    • Renamed termcolor feature to color
    • Renamed atty feature to auto-color

    0.9.3 - 2022-11-07

    • Fix a regression from v0.9.2 where env_logger would fail to compile with the termcolor feature turned off.

    0.9.2 - 2022-11-07

    • Fix and un-deprecate Target::Pipe, which was basically not working at all before and deprecated in 0.9.1.

    0.9.0 -- 2022-07-14

    Breaking Changes

    • Default message format now prints the target instead of the module

    Improvements

    • Added a method to print the module instead of the target
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump syntect from 4.7.1 to 5.0.0

    Bump syntect from 4.7.1 to 5.0.0

    Bumps syntect from 4.7.1 to 5.0.0.

    Release notes

    Sourced from syntect's releases.

    Breaking changes for improved startup time and error handling!

    Thanks to @​Enselic for basically all the work to make this release happen!

    Breaking changes

    • Lazy-load syntaxes to significantly improve startup time. This changes the binary format of syntax dump files.
    • Remove ContextId::new() from public API to support lazy-loading of syntaxes
    • Rename HighlightLines::highlight() to HighlightLines::highlight_line() to make it clear that the function takes one line at a time
    • Make plist dependency (used for loading themes) optional via new plist-load feature
    • Remove obsolete dump-load-rs and dump-create-rs features that has been identical to dump-load and dump-create for two years
    • Remove deprecated items ThemeSettings::highlight_foreground, ThemeSettings::selection_background, ClassedHTMLGenerator::new, ClassedHTMLGenerator::parse_html_for_line, html::css_for_theme, html::tokens_to_classed_html and html::tokens_to_classed_spans
    • Mark all error enums as #[non_exhaustive]
    • These functions have been changed to return a Result to allow propagation of errors:
      • html::ClassedHTMLGenerator::parse_html_for_line_which_includes_newline
      • html::append_highlighted_html_for_styled_line
      • html::css_for_theme_with_class_style
      • html::highlighted_html_for_string
      • html::line_tokens_to_classed_spans
      • html::styled_line_to_highlighted_html
      • parsing::ParseState::parse_line
      • parsing::ScopeStack::apply
      • parsing::ScopeStack::apply_with_hook
      • parsing::syntax_definition::Context::match_at
      • parsing::syntax_definition::ContextReference::id
      • parsing::syntax_definition::ContextReference::resolve

    Other changes

    • Fall back to Plain Text if a referenced syntax is missing
    • Add support for hidden_file_extensions key in syntaxes.
    • Implement Error and Display for all error enums by using thiserror
    • Replace lazycell with once_cell to fix crash on lazy initialization
    • Add ScopeRangeIterator
    • Add CI check for Minimum Supported Rust Version. This is currently Rust 1.53.
    • Make looking up a syntax by extension use case-insensitive comparison
    • Make from_dump_file() ~15% faster
    • Blend alpha value on converting colors to ANSI color sequences
    • Fix sample code in documentation to avoid double newlines
    • Fix lots of build warnings and lints
    • Add Criterion benchmarks for a whole syntect pipeline and for from_dump_file()
    Changelog

    Sourced from syntect's changelog.

    Version 5.0.0 (2022-05-03)

    Breaking changes

    • Lazy-load syntaxes to significantly improve startup time. This changes the binary format of syntax dump files.
    • Remove ContextId::new() from public API to support lazy-loading of syntaxes
    • Rename HighlightLines::highlight() to HighlightLines::highlight_line() to make it clear that the function takes one line at a time
    • Make plist dependency (used for loading themes) optional via new plist-load feature
    • Remove obsolete dump-load-rs and dump-create-rs features that has been identical to dump-load and dump-create for two years
    • Remove deprecated items ThemeSettings::highlight_foreground, ThemeSettings::selection_background, ClassedHTMLGenerator::new, ClassedHTMLGenerator::parse_html_for_line, html::css_for_theme, html::tokens_to_classed_html and html::tokens_to_classed_spans
    • Mark all error enums as #[non_exhaustive]
    • These functions have been changed to return a Result to allow propagation of errors:
      • html::ClassedHTMLGenerator::parse_html_for_line_which_includes_newline
      • html::append_highlighted_html_for_styled_line
      • html::css_for_theme_with_class_style
      • html::highlighted_html_for_string
      • html::line_tokens_to_classed_spans
      • html::styled_line_to_highlighted_html
      • parsing::ParseState::parse_line
      • parsing::ScopeStack::apply
      • parsing::ScopeStack::apply_with_hook
      • parsing::syntax_definition::Context::match_at
      • parsing::syntax_definition::ContextReference::id
      • parsing::syntax_definition::ContextReference::resolve

    Other changes

    • Fall back to Plain Text if a referenced syntax is missing
    • Add support for hidden_file_extensions key in syntaxes.
    • Implement Error and Display for all error enums by using thiserror
    • Replace lazycell with once_cell to fix crash on lazy initialization
    • Add ScopeRangeIterator
    • Add CI check for Minimum Supported Rust Version. This is currently Rust 1.53.
    • Make looking up a syntax by extension use case-insensitive comparison
    • Make from_dump_file() ~15% faster
    • Blend alpha value on converting colors to ANSI color sequences
    • Fix sample code in documentation to avoid double newlines
    • Fix lots of build warnings and lints
    • Add Criterion benchmarks for a whole syntect pipeline and for from_dump_file()
    Commits
    • e8c1f31 Release date for 5.0.0
    • 1184978 Merge pull request #409 from Enselic/prepare-for-5.0.0
    • a47dbdf Merge pull request #432 from Enselic/dont-panic
    • e8535c1 CHANGELOG.md: Update to include PR #432
    • dcd439e CHANGELOG.md: Update with latest changes on master
    • c7ee51e Merge remote-tracking branch 'origin/master' into prepare-for-5.0.0
    • 46882e1 Replace direct panics with Errors
    • 6b211f9 Merge pull request #419 from sourcegraph/vg/upstream/hidden-file-extensions
    • e54eef3 Add support for hidden_file_extensions key.
    • ce1ba5b Merge pull request #426 from Enselic/parse-and-highlight-line-with-result
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
Releases(0.10.3)
  • 0.10.3(Jun 5, 2020)

  • 0.10.2(May 28, 2020)

  • 0.10.1(Jun 22, 2019)

  • 0.10.0(Feb 22, 2019)

    Added ability to choose what kind of format a flowgraph is rendered to using the --format argument. The default flowgraph format is now SVG.

    Source code(tar.gz)
    Source code(zip)
  • 0.9.0(Feb 15, 2019)

  • 0.8.1(Feb 5, 2019)

    This release removes the implicit dependency on git2 caused by prettyprint (see https://github.com/mre/prettyprint/issues/6). This fixes compilation on macOS in the case where openssl wasn't installed. Thanks to @lilyball for reporting.

    Source code(tar.gz)
    Source code(zip)
  • 0.8.0(Feb 5, 2019)

    This release adds two nice features to cargo-inspect:

    • You can now choose different themes! Simply run cargo inspect --list-themes to get a list of available choices. For example, this will use the GitHub theme, which should work well on white backgrounds: cargo inspect examples/file.rs --theme GitHub [Thanks to @jonathansty]
    • The output is now a bit cleaner, because formatting issues are now handled a little better. Even if rustfmt fails, we print the final output on a best-effort basis. Most of the time, this should look quite pleasing to the eye. If you want to see the full debug trace, you can use RUST_LOG=debug. [Thanks to @jonathansty]
    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Feb 3, 2019)

  • 0.6.0(Jan 29, 2019)

  • 0.5.0(Dec 16, 2018)

Owner
Matthias
Curious person. Maker. Rustacean. Oxidizing things.
Matthias
Check Have I Been Pwned and see if it's time for you to change passwords.

checkpwn Check Have I Been Pwned and see if it's time for you to change passwords. Getting started Install: cargo install checkpwn Update: cargo inst

Johannes 93 Dec 13, 2022
k-mer counter in Rust using the rust-bio and rayon crates

krust is a k-mer counter written in Rust and run from the command line that will output canonical k-mers and their frequency across the records in a f

null 14 Jan 7, 2023
Experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code

Diplomat is an experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code. With Diplomat, you can simply define Rust APIs to be exposed over FFI and get high-level C, C++, and JavaScript bindings automatically!

null 255 Dec 30, 2022
Aws-sdk-rust - AWS SDK for the Rust Programming Language

The AWS SDK for Rust This repo contains the new AWS SDK for Rust (the SDK) and its public roadmap. Please Note: The SDK is currently released as a dev

Amazon Web Services - Labs 2k Jan 3, 2023
Rust + Yew + Axum + Tauri, full-stack Rust development for Desktop apps.

rust-yew-axum-tauri-desktop template Rust + Yew + Axum + Tauri, full-stack Rust development for Desktop apps. Crates frontend: Yew frontend app for de

Jet Li 54 Dec 23, 2022
A lightning fast version of tmux-fingers written in Rust, copy/pasting tmux like vimium/vimperator

tmux-thumbs A lightning fast version of tmux-fingers written in Rust for copy pasting with vimium/vimperator like hints. Usage Press ( prefix + Space

Ferran Basora 598 Jan 2, 2023
A command-line tool collection to assist development written in RUST

dtool dtool is a command-line tool collection to assist development Table of Contents Description Usage Tips Installation Description Now dtool suppor

GB 314 Dec 18, 2022
Rust mid-level IR Abstract Interpreter

MIRAI MIRAI is an abstract interpreter for the Rust compiler's mid-level intermediate representation (MIR). It is intended to become a widely used sta

Facebook Experimental 793 Jan 2, 2023
Migrate C code to Rust

C2Rust helps you migrate C99-compliant code to Rust. The translator (or transpiler) produces unsafe Rust code that closely mirrors the input C code. T

Immunant 3k Jan 8, 2023
C to Rust translator

Corrode: Automatic semantics-preserving translation from C to Rust This program reads a C source file and prints an equivalent module in Rust syntax.

Jamey Sharp 2.1k Dec 14, 2022
Astronomical algorithms in Rust

astro-rust Contents API Docs About Usage Contributing References About astro-rust is a library of advanced astronomical algorithms for the Rust progra

Saurav Sachidanand 213 Jan 7, 2023
A Rust library for calculating sun positions

sun A rust port of the JS library suncalc. Install Add the following to your Cargo.toml [dependencies] sun = "0.2" Usage pub fn main() { let unixti

Markus Kohlhase 36 Dec 28, 2022
Macro for Python-esque comprehensions in Rust

Cute Macro for Python-esque list comprehensions in Rust. The c! macro implements list and hashmap comprehensions similar to those found in Python, all

Matt Gathu 306 Jan 6, 2023
Language Integrated Query in Rust.

Linq in Rust Language Integrated Query in Rust (created by declarative macros). Inspired by LINQ in .NET. What's LINQ This project is under developmen

StardustDL 91 Dec 8, 2022
A cross-platform serial port library in Rust.

Introduction serialport-rs is a general-purpose cross-platform serial port library for Rust. It provides a blocking I/O interface and port enumeration

Bryant Mairs 143 Nov 5, 2021
A Rust macro for writing regex pattern matching.

regexm A Rust macro for writing regex pattern matching.

Takayuki Maeda 46 Oct 24, 2022
Simple ray tracer written in Rust

Simple ray tracer written in Rust from scratch I've just finished my first semester at the Faculty of Applied Mathematics and Computer Science at the

Vladislav 190 Dec 21, 2022
A high level diffing library for rust based on diffs

Similar: A Diffing Library Similar is a dependency free crate for Rust that implements different diffing algorithms and high level interfaces for it.

Armin Ronacher 617 Dec 30, 2022
A reactive DOM library for Rust in WASM

maple A VDOM-less web library with fine-grained reactivity. Getting started The recommended build tool is Trunk. Start by adding maple-core to your Ca

Luke Chu 1.8k Jan 3, 2023