Remove another gazillion allocations from reporting

This commit is contained in:
Richard Feldman 2022-04-19 20:25:28 -04:00
parent 27edc49271
commit 40aca3c20d
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798
6 changed files with 218 additions and 223 deletions

View file

@ -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, "),