Browse Source

Hasty sketch at rust demangling (work in progress); c.f #213

dev/git-series/gccdum
Matt Godbolt 6 years ago
parent
commit
73880b9033
  1. 1
      rust/.gitignore
  2. 14
      rust/Cargo.lock
  3. 7
      rust/Cargo.toml
  4. 21
      rust/src/main.rs

1
rust/.gitignore vendored

@ -0,0 +1 @@
target

14
rust/Cargo.lock generated

@ -0,0 +1,14 @@
[root]
name = "rustfilt"
version = "0.1.0"
dependencies = [
"rustc-demangle 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-demangle"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum rustc-demangle 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1430d286cadb237c17c885e25447c982c97113926bb579f4379c0eca8d9586dc"

7
rust/Cargo.toml

@ -0,0 +1,7 @@
[package]
name = "rustfilt"
version = "0.1.0"
authors = ["Matt Godbolt <matt@godbolt.org>"]
[dependencies]
rustc-demangle = "*"

21
rust/src/main.rs

@ -0,0 +1,21 @@
use std::io;
use std::io::prelude::*;
use rustc_demangle::demangle;
extern crate rustc_demangle;
fn main() {
let stdin = io::stdin();
for line in stdin.lock().lines() {
let a = line.unwrap();
println!("{}", demangle(&a));
}
/*
let var: Vec<String> = input.split(' ')
.into_iter()
.map(|x| demangle(x).to_string())
.collect();
println!("{}", var.join(" "));
*/
}
Loading…
Cancel
Save