From c3fcfd65cba8b3036eb01f2a877d17dba5c653b8 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Fri, 6 Mar 2020 02:06:18 -0500 Subject: [PATCH] Move reporting into its own crate --- Cargo.lock | 16 ++++++++++++++++ Cargo.toml | 1 + compiler/reporting/Cargo.toml | 19 +++++++++++++++++++ compiler/reporting/src/lib.rs | 14 ++++++++++++++ .../reporting.rs => reporting/src/report.rs} | 0 compiler/src/lib.rs | 1 - 6 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 compiler/reporting/Cargo.toml create mode 100644 compiler/reporting/src/lib.rs rename compiler/{src/reporting.rs => reporting/src/report.rs} (100%) diff --git a/Cargo.lock b/Cargo.lock index 3247f2ce5e..941dbbf67c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1011,6 +1011,22 @@ dependencies = [ name = "roc_region" version = "0.1.0" +[[package]] +name = "roc_reporting" +version = "0.1.0" +dependencies = [ + "indoc", + "maplit", + "pretty_assertions", + "quickcheck", + "quickcheck_macros", + "roc_collections", + "roc_module", + "roc_problem", + "roc_region", + "roc_types", +] + [[package]] name = "roc_solve" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 1ad1ed0b7c..5414635d63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ members = [ "compiler/constrain", "compiler/unify", "compiler/solve", + "compiler/reporting", "vendor/ena", "vendor/pathfinding" ] diff --git a/compiler/reporting/Cargo.toml b/compiler/reporting/Cargo.toml new file mode 100644 index 0000000000..ca4e7016f2 --- /dev/null +++ b/compiler/reporting/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "roc_reporting" +version = "0.1.0" +authors = ["Richard Feldman "] +edition = "2018" + +[dependencies] +roc_collections = { path = "../collections" } +roc_region = { path = "../region" } +roc_module = { path = "../module" } +roc_problem = { path = "../problem" } +roc_types = { path = "../types" } + +[dev-dependencies] +pretty_assertions = "0.5.1 " +maplit = "1.0.1" +indoc = "0.3.3" +quickcheck = "0.8" +quickcheck_macros = "0.8" diff --git a/compiler/reporting/src/lib.rs b/compiler/reporting/src/lib.rs new file mode 100644 index 0000000000..a594ebf347 --- /dev/null +++ b/compiler/reporting/src/lib.rs @@ -0,0 +1,14 @@ +#![warn(clippy::all, clippy::dbg_macro)] +// I'm skeptical that clippy:large_enum_variant is a good lint to have globally enabled. +// +// It warns about a performance problem where the only quick remediation is +// to allocate more on the heap, which has lots of tradeoffs - including making it +// long-term unclear which allocations *need* to happen for compilation's sake +// (e.g. recursive structures) versus those which were only added to appease clippy. +// +// Effectively optimizing data struture memory layout isn't a quick fix, +// and encouraging shortcuts here creates bad incentives. I would rather temporarily +// re-enable this when working on performance optimizations than have it block PRs. +#![allow(clippy::large_enum_variant)] + +pub mod report; diff --git a/compiler/src/reporting.rs b/compiler/reporting/src/report.rs similarity index 100% rename from compiler/src/reporting.rs rename to compiler/reporting/src/report.rs diff --git a/compiler/src/lib.rs b/compiler/src/lib.rs index 364200a150..d66a4dde65 100644 --- a/compiler/src/lib.rs +++ b/compiler/src/lib.rs @@ -18,4 +18,3 @@ pub mod fmt; pub mod llvm; pub mod load; pub mod mono; -pub mod reporting;