graydon/rust — Issue #1299: invalid format string causes leaked memory in rust main loop
Author: grahame
Created: 2011-12-14 17:43:52+00:00
State: open

The following program;

use std;
import std::io;

fn main(arg : [str])
{
std::io::println(#fmt("%r", "Goat"));
}

fails to compile with the following internal error:

herugrim::~/code/markov2 $ rustc markov.rs
markov.rs:6:26: 6:30 error: unknown type in conversion: r
markov.rs:6 std::io::println(#fmt("%r", "Goat"));
^~~~
rust: upcall fail 'explicit failure', src/comp/driver/session.rs:70
rust: domain main @0x7fd001021200 root task failed
rust: fatal, 'leaked memory in rust main loop (2 objects)' failed, ./src/rt/memory_region.cpp:158 2 objects

I'm on MacOS lion, and I'm running rev 283cf3541565ce12cc267fed6ef064a24325d1f5 of rust.