In theory you could tell the compiler to identify and statically link only those functions needed to make printf work (or a conservative approximation thereof).
As far as I know, jemalloc is a substantial part of that binary size. See e.g.:
https://github.com/japaric/rust-on-openwrt/issues/1#issuecom...
https://github.com/japaric/std-with-cargo#making-rust-binari...
Re:Announcing Rust 1.7
by Manishearth on Friday March 04, 2016 @04:35AM
(#11222822)
Yeah, that's just running LTO (`-C lto`). This brings the binary size down a bit, thought you also need to opt out of jemalloc to get a good impact.
Re:Announcing Rust 1.7
by Manishearth on Friday March 04, 2016 @04:31AM
(#11222819)
Edit: *doesn't
The size is due to a statically linked stdlib (also jemalloc, which you can decide not to use) -- your C program is tiny because your system has a stdlib it can dynamically link to. Rust can do this too, it's just not the default since in most cases this additive extra binary size isn't a problem.
Being a systems language does mean we should forgo sensible defaults.