mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
clippy+fmt
This commit is contained in:
parent
e9d8d13b02
commit
b681949461
5 changed files with 14 additions and 11 deletions
|
@ -118,7 +118,12 @@ mod cli_run {
|
||||||
panic!("\n___________\nThe roc command:\n\n {}\n\nhad unexpected stderr:\n\n {}\n___________\n", compile_out.cmd_str, stderr);
|
panic!("\n___________\nThe roc command:\n\n {}\n\nhad unexpected stderr:\n\n {}\n___________\n", compile_out.cmd_str, stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert!(compile_out.status.success(), "\n___________\nRoc command failed with status {:?}:\n\n {:?}\n___________\n", compile_out.status, compile_out);
|
assert!(
|
||||||
|
compile_out.status.success(),
|
||||||
|
"\n___________\nRoc command failed with status {:?}:\n\n {:?}\n___________\n",
|
||||||
|
compile_out.status,
|
||||||
|
compile_out
|
||||||
|
);
|
||||||
|
|
||||||
compile_out
|
compile_out
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,14 +222,14 @@ fn run_command(mut command: Command, flaky_fail_counter: usize) {
|
||||||
} else {
|
} else {
|
||||||
run_command(command, flaky_fail_counter + 1)
|
run_command(command, flaky_fail_counter + 1)
|
||||||
}
|
}
|
||||||
} else {
|
} else if error_str
|
||||||
if error_str.contains("lld-link: error: failed to write the output file: Permission denied") {
|
.contains("lld-link: error: failed to write the output file: Permission denied")
|
||||||
panic!("{} failed with:\n\n {}\n\nWorkaround:\n\n Re-run the cargo command that triggered this build.", command_str, error_str);
|
{
|
||||||
|
panic!("{} failed with:\n\n {}\n\nWorkaround:\n\n Re-run the cargo command that triggered this build.\n\n", command_str, error_str);
|
||||||
} else {
|
} else {
|
||||||
panic!("{} failed with:\n\n {}\n", command_str, error_str);
|
panic!("{} failed with:\n\n {}\n", command_str, error_str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
Err(reason) => panic!("{} failed: {}", command_str, reason),
|
Err(reason) => panic!("{} failed: {}", command_str, reason),
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ const NEWLINE: &str = "\r\n";
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
const NEWLINE: &str = "\n";
|
const NEWLINE: &str = "\n";
|
||||||
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Ast<'a> {
|
pub struct Ast<'a> {
|
||||||
pub module: Module<'a>,
|
pub module: Module<'a>,
|
||||||
|
|
|
@ -4,6 +4,7 @@ use std::path::{Path, PathBuf};
|
||||||
use bumpalo::Bump;
|
use bumpalo::Bump;
|
||||||
use roc_module::symbol::ModuleId;
|
use roc_module::symbol::ModuleId;
|
||||||
|
|
||||||
|
#[cfg(not(windows))]
|
||||||
const ROC_SKIP_SUBS_CACHE: &str = "ROC_SKIP_SUBS_CACHE";
|
const ROC_SKIP_SUBS_CACHE: &str = "ROC_SKIP_SUBS_CACHE";
|
||||||
|
|
||||||
const SKIP_SUBS_CACHE: bool = {
|
const SKIP_SUBS_CACHE: bool = {
|
||||||
|
|
|
@ -3,7 +3,7 @@ use snafu::OptionExt;
|
||||||
use std::{
|
use std::{
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
env::{self, VarError},
|
env::{self, VarError},
|
||||||
path::PathBuf,
|
path::{Path, PathBuf},
|
||||||
process::Command,
|
process::Command,
|
||||||
slice::SliceIndex,
|
slice::SliceIndex,
|
||||||
};
|
};
|
||||||
|
@ -107,7 +107,6 @@ pub fn get_lib_path() -> Option<PathBuf> {
|
||||||
let exe_relative_str_path_opt = std::env::current_exe().ok();
|
let exe_relative_str_path_opt = std::env::current_exe().ok();
|
||||||
|
|
||||||
if let Some(exe_relative_str_path) = exe_relative_str_path_opt {
|
if let Some(exe_relative_str_path) = exe_relative_str_path_opt {
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
let exe_relative_str_path = strip_windows_prefix(&exe_relative_str_path);
|
let exe_relative_str_path = strip_windows_prefix(&exe_relative_str_path);
|
||||||
|
|
||||||
|
@ -136,8 +135,7 @@ pub fn get_lib_path() -> Option<PathBuf> {
|
||||||
/// Such a path does not works as an argument to `zig` and other command line tools,
|
/// Such a path does not works as an argument to `zig` and other command line tools,
|
||||||
/// and there seems to be no good way to strip it. So we resort to some string manipulation.
|
/// and there seems to be no good way to strip it. So we resort to some string manipulation.
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub fn strip_windows_prefix(path_buf: &PathBuf) -> std::path::PathBuf {
|
pub fn strip_windows_prefix(path_buf: &Path) -> std::path::PathBuf {
|
||||||
|
|
||||||
let path_str = path_buf.display().to_string();
|
let path_str = path_buf.display().to_string();
|
||||||
|
|
||||||
std::path::Path::new(path_str.trim_start_matches(r"\\?\")).to_path_buf()
|
std::path::Path::new(path_str.trim_start_matches(r"\\?\")).to_path_buf()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue