Ответ 1
Да, вы можете передать специальный флаг в rustc
, называемый --pretty=expanded
:
% cat test.rs
fn main() {
println!("Hello world");
}
% rustc -Z unstable-options --pretty=expanded test.rs
#![feature(no_std)]
#![no_std]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate "std" as std;
fn main() {
::std::old_io::stdio::println_args(::std::fmt::Arguments::new_v1({
static __STATIC_FMTSTR:
&'static [&'static str]
=
&["Hello world"];
__STATIC_FMTSTR
},
&match ()
{
()
=>
[],
}));
}
Вы должны разрешить это сначала, передав -Z unstable-options
.
С Rust 1.1 вы можете передать эти аргументы в Cargo, например:
cargo rustc -- -Z unstable-options --pretty=expanded