mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Cleanup
This commit is contained in:
parent
5f8834d6b4
commit
afe49cf570
3 changed files with 5 additions and 22 deletions
|
@ -83,15 +83,12 @@ fn create_llvm_module<'a>(
|
||||||
let mut delayed_errors = Vec::new();
|
let mut delayed_errors = Vec::new();
|
||||||
|
|
||||||
for (home, (module_path, src)) in loaded.sources {
|
for (home, (module_path, src)) in loaded.sources {
|
||||||
use roc_reporting::report::{
|
use roc_reporting::report::{can_problem, type_problem, RocDocAllocator, DEFAULT_PALETTE};
|
||||||
can_problem, mono_problem, type_problem, RocDocAllocator, DEFAULT_PALETTE,
|
|
||||||
};
|
|
||||||
|
|
||||||
let can_problems = loaded.can_problems.remove(&home).unwrap_or_default();
|
let can_problems = loaded.can_problems.remove(&home).unwrap_or_default();
|
||||||
let type_problems = loaded.type_problems.remove(&home).unwrap_or_default();
|
let type_problems = loaded.type_problems.remove(&home).unwrap_or_default();
|
||||||
let mono_problems = loaded.mono_problems.remove(&home).unwrap_or_default();
|
|
||||||
|
|
||||||
let error_count = can_problems.len() + type_problems.len() + mono_problems.len();
|
let error_count = can_problems.len() + type_problems.len();
|
||||||
|
|
||||||
if error_count == 0 {
|
if error_count == 0 {
|
||||||
continue;
|
continue;
|
||||||
|
@ -144,16 +141,6 @@ fn create_llvm_module<'a>(
|
||||||
lines.push(buf);
|
lines.push(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for problem in mono_problems {
|
|
||||||
let report = mono_problem(&alloc, &line_info, module_path.clone(), problem);
|
|
||||||
let mut buf = String::new();
|
|
||||||
|
|
||||||
report.render_color_terminal(&mut buf, &alloc, &palette);
|
|
||||||
|
|
||||||
delayed_errors.push(buf.clone());
|
|
||||||
lines.push(buf);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !lines.is_empty() {
|
if !lines.is_empty() {
|
||||||
|
|
|
@ -5,9 +5,6 @@
|
||||||
// we actually want to compare against the literal float bits
|
// we actually want to compare against the literal float bits
|
||||||
#![allow(clippy::float_cmp)]
|
#![allow(clippy::float_cmp)]
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate pretty_assertions;
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate indoc;
|
extern crate indoc;
|
||||||
|
|
||||||
|
@ -123,14 +120,12 @@ fn compiles_to_ir(test_name: &str, src: &str) {
|
||||||
|
|
||||||
let can_problems = loaded.can_problems.remove(&home).unwrap_or_default();
|
let can_problems = loaded.can_problems.remove(&home).unwrap_or_default();
|
||||||
let type_problems = loaded.type_problems.remove(&home).unwrap_or_default();
|
let type_problems = loaded.type_problems.remove(&home).unwrap_or_default();
|
||||||
let mono_problems = loaded.mono_problems.remove(&home).unwrap_or_default();
|
|
||||||
|
|
||||||
if !can_problems.is_empty() {
|
if !can_problems.is_empty() {
|
||||||
println!("Ignoring {} canonicalization problems", can_problems.len());
|
println!("Ignoring {} canonicalization problems", can_problems.len());
|
||||||
}
|
}
|
||||||
|
|
||||||
assert!(type_problems.is_empty());
|
assert!(type_problems.is_empty());
|
||||||
assert_eq!(mono_problems, Vec::new());
|
|
||||||
|
|
||||||
debug_assert_eq!(exposed_to_host.values.len(), 1);
|
debug_assert_eq!(exposed_to_host.values.len(), 1);
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,7 @@ use roc_module::symbol::Symbol;
|
||||||
use roc_types::subs::Content::{self, *};
|
use roc_types::subs::Content::{self, *};
|
||||||
use roc_types::subs::{
|
use roc_types::subs::{
|
||||||
AliasVariables, Descriptor, ErrorTypeContext, FlatType, GetSubsSlice, Mark, OptVariable,
|
AliasVariables, Descriptor, ErrorTypeContext, FlatType, GetSubsSlice, Mark, OptVariable,
|
||||||
RecordFields, Subs, SubsFmtContent, SubsIndex, SubsSlice, UnionTags, Variable,
|
RecordFields, Subs, SubsIndex, SubsSlice, UnionTags, Variable, VariableSubsSlice,
|
||||||
VariableSubsSlice,
|
|
||||||
};
|
};
|
||||||
use roc_types::types::{AliasKind, DoesNotImplementAbility, ErrorType, Mismatch, RecordField};
|
use roc_types::types::{AliasKind, DoesNotImplementAbility, ErrorType, Mismatch, RecordField};
|
||||||
|
|
||||||
|
@ -295,6 +294,8 @@ pub fn unify_pool(
|
||||||
/// NOTE: Only run this on individual tests! Run on multiple threads, this would clobber each others' output.
|
/// NOTE: Only run this on individual tests! Run on multiple threads, this would clobber each others' output.
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
fn debug_print_unified_types(subs: &mut Subs, ctx: &Context, opt_outcome: Option<&Outcome>) {
|
fn debug_print_unified_types(subs: &mut Subs, ctx: &Context, opt_outcome: Option<&Outcome>) {
|
||||||
|
use roc_types::subs::SubsFmtContent;
|
||||||
|
|
||||||
static mut UNIFICATION_DEPTH: usize = 0;
|
static mut UNIFICATION_DEPTH: usize = 0;
|
||||||
|
|
||||||
if std::env::var("ROC_PRINT_UNIFICATIONS").is_ok() {
|
if std::env::var("ROC_PRINT_UNIFICATIONS").is_ok() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue