gnzlbg / cargo-asm

cargo subcommand showing the assembly or llvm-ir generated for Rust code
https://github.com/gnzlbg/cargo-asm
Other
1.18k stars 36 forks source link

cargo-asm panics on unwrapping a directory #249

Open ernieIzde8ski opened 10 months ago

ernieIzde8ski commented 10 months ago

I wrote the following program:

use std::f64::consts::{E, PI};

fn power_squared(a: f64, b: f64) -> f64 {
    a.powf(b).powf(2.0)
}

fn doubled_exp(a: f64, b: f64) -> f64 {
    a.powf(b * 2.0)
}

fn main() {
    println!("{}", power_squared(E, PI));
    println!("{}", doubled_exp(E, PI));
}

and I tried to get the assembly for the former function, which caused a panic:

[2 0] ernie@vivec% cargo asm --build-type=debug playground::doubled_exp 
thread 'main' panicked at /home/ernie/.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-asm-0.1.16/src/rust.rs:123:33:
called `Result::unwrap()` on an `Err` value: Os { code: 21, kind: IsADirectory, message: "Is a directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

cargo 1.74.0 rustc 1.74.0 cargo-asm 0.1.16

pacak commented 8 months ago

cargo-asm is no longer maintained, you can try cargo-show-asm instead.