Move macros from roc_reporting to new roc_error_macros module

The `internal_error!` and `user_error!´ macros can't be used everywhere
when they live in `roc_reporting` due to circular dependencies.
This commit is contained in:
Mats Sigge 2022-01-23 09:40:34 +01:00
parent 2b3f347eec
commit 71f359fbdc
27 changed files with 71 additions and 57 deletions

View file

@ -12,8 +12,8 @@ use roc_mono::ir::{
ProcLayout, Stmt,
};
use roc_error_macros::internal_error;
use roc_mono::layout::{Builtin, Layout, LayoutIds, TagIdIntType, UnionLayout};
use roc_reporting::internal_error;
use crate::layout::{CallConv, ReturnMethod, WasmLayout};
use crate::low_level::LowLevelCall;

View file

@ -1,9 +1,9 @@
use bumpalo::collections::Vec;
use roc_builtins::bitcode::{self, FloatWidth, IntWidth};
use roc_error_macros::internal_error;
use roc_module::low_level::{LowLevel, LowLevel::*};
use roc_module::symbol::Symbol;
use roc_mono::layout::{Builtin, Layout, UnionLayout};
use roc_reporting::internal_error;
use crate::backend::WasmBackend;
use crate::layout::CallConv;

View file

@ -2,9 +2,9 @@ use bumpalo::collections::Vec;
use bumpalo::Bump;
use roc_collections::all::MutMap;
use roc_error_macros::internal_error;
use roc_module::symbol::Symbol;
use roc_mono::layout::Layout;
use roc_reporting::internal_error;
use crate::layout::{
CallConv, ReturnMethod, StackMemoryFormat, WasmLayout, ZigVersion, BUILTINS_ZIG_VERSION,

View file

@ -1,7 +1,7 @@
use bumpalo::collections::vec::Vec;
use bumpalo::Bump;
use core::panic;
use roc_reporting::internal_error;
use roc_error_macros::internal_error;
use roc_module::symbol::Symbol;

View file

@ -8,7 +8,7 @@ pub mod serialize;
use bumpalo::Bump;
pub use code_builder::{Align, CodeBuilder, LocalId, ValueType, VmSymbolState};
pub use linking::SymInfo;
use roc_reporting::internal_error;
use roc_error_macros::internal_error;
pub use sections::{ConstExpr, Export, ExportType, Global, GlobalType, Signature};
use crate::wasm_module::serialize::SkipBytes;

View file

@ -1,4 +1,4 @@
use roc_reporting::internal_error;
use roc_error_macros::internal_error;
use super::serialize::{parse_u32_or_panic, SkipBytes};

View file

@ -1,7 +1,7 @@
use bumpalo::collections::vec::Vec;
use bumpalo::Bump;
use roc_collections::all::MutMap;
use roc_reporting::internal_error;
use roc_error_macros::internal_error;
use super::dead_code::{
copy_preloads_shrinking_dead_fns, parse_preloads_call_graph, trace_call_graph,

View file

@ -1,7 +1,7 @@
use std::{fmt::Debug, iter::FromIterator};
use bumpalo::collections::vec::Vec;
use roc_reporting::internal_error;
use roc_error_macros::internal_error;
/// In the WebAssembly binary format, all integers are variable-length encoded (using LEB-128)
/// A small value like 3 or 100 is encoded as 1 byte. The value 128 needs 2 bytes, etc.