mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
stop escaping roc panic strings in the llvm helpers
This commit is contained in:
parent
9f80aa4df7
commit
291b77c83b
2 changed files with 3 additions and 28 deletions
|
@ -39,12 +39,7 @@ impl<T: Sized> From<RocCallResult<T>> for Result<T, String> {
|
|||
_ => Err({
|
||||
let raw = unsafe { CString::from_raw(call_result.error_msg) };
|
||||
|
||||
let result = format!("{:?}", raw);
|
||||
|
||||
// make sure rust does not try to free the Roc string
|
||||
std::mem::forget(raw);
|
||||
|
||||
result
|
||||
raw.into_string().unwrap()
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1038,28 +1038,8 @@ fn different_proc_types_specialized_to_same_layout() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
#[should_panic(
|
||||
// TODO: something upstream is escaping the '
|
||||
// NOTE: Are we sure it's upstream? It's not escaped in gen-wasm version below!
|
||||
expected = r#"Roc failed with message: "Can\'t create record with improper layout""#
|
||||
)]
|
||||
fn call_with_bad_record_runtime_error() {
|
||||
expect_runtime_error_panic!(indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
get : {a: Bool} -> Bool
|
||||
get = \{a} -> a
|
||||
get {b: ""}
|
||||
"#
|
||||
))
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-wasm"))]
|
||||
#[should_panic(expected = r#"Roc failed with message: "Can't create record with improper layout"#)]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
#[should_panic(expected = r#"Roc failed with message: "Can't create record with improper layout""#)]
|
||||
fn call_with_bad_record_runtime_error() {
|
||||
expect_runtime_error_panic!(indoc!(
|
||||
r#"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue