Remove pub(crate)

This commit is contained in:
Jef 2018-12-11 13:04:37 +01:00
parent c8bae0f4b1
commit 9fa0722cf6
2 changed files with 18 additions and 15 deletions

View File

@ -137,7 +137,7 @@ extern crate libm;
#[derive(Debug)] #[derive(Debug)]
pub struct Trap { pub struct Trap {
// Needs to be `pub(crate)` to allow `if let` matching in tests // Needs to be `pub(crate)` to allow `if let` matching in tests
pub(crate) kind: TrapKind, kind: TrapKind,
} }
impl Trap { impl Trap {

View File

@ -338,21 +338,24 @@ fn resume_call_host_func_type_mismatch() {
} }
assert!(invocation.is_resumable()); assert!(invocation.is_resumable());
match invocation let err = invocation.resume_execution(val, &mut env).unwrap_err();
.resume_execution(val, &mut env)
.unwrap_err() match &err {
{ ResumableError::Trap(trap) => {
ResumableError::Trap(Trap { if let TrapKind::UnexpectedSignature = trap.kind() {
kind: TrapKind::UnexpectedSignature, return;
}) => { }
// success
} }
other => panic!( _ => {}
"Expected `ResumableError::Trap(Trap {{ kind: \ }
TrapKind::UnexpectedSignature, }})`, got `{:?}`",
other // If didn't return in the previous `match`...
),
}; panic!(
"Expected `ResumableError::Trap(Trap {{ kind: \
TrapKind::UnexpectedSignature, }})`, got `{:?}`",
err
)
} }
resume_with_val(None); resume_with_val(None);