mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
clippy
This commit is contained in:
parent
eb17e8de5d
commit
8b36bfbc71
1 changed files with 0 additions and 30 deletions
|
@ -6151,36 +6151,6 @@ fn add_needed_external<'a>(
|
||||||
existing.insert(name, solved_type);
|
existing.insert(name, solved_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn can_throw_exception(call: &Call) -> bool {
|
|
||||||
match call.call_type {
|
|
||||||
CallType::ByName { name, .. } => matches!(
|
|
||||||
name,
|
|
||||||
Symbol::NUM_ADD
|
|
||||||
| Symbol::NUM_SUB
|
|
||||||
| Symbol::NUM_MUL
|
|
||||||
| Symbol::NUM_DIV_FLOAT
|
|
||||||
| Symbol::NUM_ABS
|
|
||||||
| Symbol::NUM_NEG
|
|
||||||
),
|
|
||||||
|
|
||||||
CallType::Foreign { .. } => {
|
|
||||||
// calling foreign functions is very unsafe
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
CallType::LowLevel { .. } => {
|
|
||||||
// lowlevel operations themselves don't throw
|
|
||||||
// TODO except for on allocation?
|
|
||||||
false
|
|
||||||
}
|
|
||||||
CallType::HigherOrderLowLevel { .. } => {
|
|
||||||
// TODO throwing is based on whether the HOF can throw
|
|
||||||
// or if there is (potentially) allocation in the lowlevel
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Symbol that links an Invoke with a Rethrow
|
/// Symbol that links an Invoke with a Rethrow
|
||||||
/// we'll assign the exception object to this symbol
|
/// we'll assign the exception object to this symbol
|
||||||
/// so we can later rethrow the exception
|
/// so we can later rethrow the exception
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue