for option in groups.iter().filter(|x| include_unstable_options || x.is_stable()) {
(option.apply)(&mut options);
}
- let message = format!("Usage: rustc [OPTIONS] INPUT");
+ let message = "Usage: rustc [OPTIONS] INPUT".to_string();
let nightly_help = if nightly_options::is_nightly_build() {
"\n -Z help Print internal options for debugging rustc"
} else {
/// debugging, since some ICEs only happens with non-default compiler flags
/// (and the users don't always report them).
fn extra_compiler_flags() -> Option<(Vec<String>, bool)> {
- let mut args = Vec::new();
- for arg in env::args_os() {
- args.push(arg.to_string_lossy().to_string());
- }
+ let args = env::args_os().map(|arg| arg.to_string_lossy().to_string()).collect::<Vec<_>>();
// Avoid printing help because of empty args. This can suggest the compiler
// itself is not the program root (consider RLS).