mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Remove another gazillion allocations from reporting
This commit is contained in:
parent
27edc49271
commit
40aca3c20d
6 changed files with 218 additions and 223 deletions
|
@ -4513,7 +4513,7 @@ fn to_file_problem_report(filename: &Path, error: io::ErrorKind) -> String {
|
|||
|
||||
let report = match error {
|
||||
io::ErrorKind::NotFound => {
|
||||
let doc = alloc.stack(vec![
|
||||
let doc = alloc.stack([
|
||||
alloc.reflow(r"I am looking for this file, but it's not there:"),
|
||||
alloc
|
||||
.parser_suggestion(filename.to_str().unwrap())
|
||||
|
@ -4532,7 +4532,7 @@ fn to_file_problem_report(filename: &Path, error: io::ErrorKind) -> String {
|
|||
}
|
||||
}
|
||||
io::ErrorKind::PermissionDenied => {
|
||||
let doc = alloc.stack(vec![
|
||||
let doc = alloc.stack([
|
||||
alloc.reflow(r"I don't have the required permissions to read this file:"),
|
||||
alloc
|
||||
.parser_suggestion(filename.to_str().unwrap())
|
||||
|
@ -4630,7 +4630,7 @@ fn to_missing_platform_report(module_id: ModuleId, other: PlatformPath) -> Strin
|
|||
match other {
|
||||
Valid(_) => unreachable!(),
|
||||
NotSpecified => {
|
||||
let doc = alloc.stack(vec![
|
||||
let doc = alloc.stack([
|
||||
alloc.reflow("I could not find a platform based on your input file."),
|
||||
alloc.reflow(r"Does the module header contain an entry that looks like this:"),
|
||||
alloc
|
||||
|
@ -4647,7 +4647,7 @@ fn to_missing_platform_report(module_id: ModuleId, other: PlatformPath) -> Strin
|
|||
}
|
||||
}
|
||||
RootIsInterface => {
|
||||
let doc = alloc.stack(vec![
|
||||
let doc = alloc.stack([
|
||||
alloc.reflow(r"The input file is an interface module, but only app modules can be ran."),
|
||||
alloc.concat([
|
||||
alloc.reflow(r"I will still parse and typecheck the input file and its dependencies, "),
|
||||
|
@ -4663,7 +4663,7 @@ fn to_missing_platform_report(module_id: ModuleId, other: PlatformPath) -> Strin
|
|||
}
|
||||
}
|
||||
RootIsHosted => {
|
||||
let doc = alloc.stack(vec![
|
||||
let doc = alloc.stack([
|
||||
alloc.reflow(r"The input file is a hosted module, but only app modules can be ran."),
|
||||
alloc.concat([
|
||||
alloc.reflow(r"I will still parse and typecheck the input file and its dependencies, "),
|
||||
|
@ -4679,7 +4679,7 @@ fn to_missing_platform_report(module_id: ModuleId, other: PlatformPath) -> Strin
|
|||
}
|
||||
}
|
||||
RootIsPkgConfig => {
|
||||
let doc = alloc.stack(vec![
|
||||
let doc = alloc.stack([
|
||||
alloc.reflow(r"The input file is a package config file, but only app modules can be ran."),
|
||||
alloc.concat([
|
||||
alloc.reflow(r"I will still parse and typecheck the input file and its dependencies, "),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue