nandi/code-transpiler-rust-frontend-findingspublic⑂ Fork 0Commits
5375d17f26e5be6bd30310edeabaaa1211437b03
⬇ Clone ▾
| Reproducible bug report for the Rust frontend in Code-Transpiler | 1 | Crate: base16ct 1.0.0 (crates.io), 613 LOC, pure Rust, no_std |
| 2 | Command: r2many transpile -from rust -to nim <file>.rs -o <file>.nim | |
| 3 | Build: CGO_ENABLED=0 go build ./cmd/r2many (succeeds) | |
| 4 | ||
| 5 | src/lib.rs unmatched delimiter ")" at 3346 -> no file written | |
| 6 | src/error.rs unterminated string at 411 -> no file written | |
| 7 | src/display.rs unmatched delimiter ")" at 174 -> no file written | |
| 8 | src/lower.rs unmatched delimiter ")" at 815 -> no file written | |
| 9 | src/upper.rs unmatched delimiter "(" at 817 -> no file written | |
| 10 | src/mixed.rs <no error, exit 0> -> mixed.nim (see below) | |
| 11 | ||
| 12 | Every failing offset lands on a lifetime: | |
| 13 | error.rs:411 fmt::Formatter<'_> | |
| 14 | display.rs:174 pub struct HexDisplay<'a>(pub &'a [u8]); | |
| 15 | lower.rs:815 pub fn encode<'a>(src: &[u8], dst: &'a mut [u8]) | |
| 16 | ||
| 17 | mixed.rs contains three functions (decode, decode_vec, decode_nibble). | |
| 18 | The complete emitted Nim program was: | |
| 19 | ||
| 20 | { | |
| 21 | } | |
| 22 | ||
| 23 | Flag behaviour on the same input: | |
| 24 | -native -> strict native frontend for "rust" is not implemented | |
| 25 | -no-runtime -> 1/1 translations failed: [{nim DIRECT_NATIVE_UNAVAILABLE (stage=direct)}] | |
| 26 | (default) -> exit 0, empty program written | |
| 27 | ||
| 28 | Control: R -> Nim on the project's original source language does emit real code. |