Skip to content

Commit

Permalink
move safety comment to unsafe block
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbepop committed Jan 31, 2023
1 parent 95ced32 commit 81a5277
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/wasmi/src/func/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,12 @@ impl From<UntypedValue> for FuncRef {

impl From<FuncRef> for UntypedValue {
fn from(funcref: FuncRef) -> Self {
let funcref = funcref.canonicalize();
// Safety: This operation is safe since there are no invalid
// bit patterns for [`UntypedValue`] instances. Therefore
// this operation cannot produce invalid [`UntypedValue`]
// instances even if it was possible to arbitrarily modify
// the input [`FuncRef`] instance.
let funcref = funcref.canonicalize();
unsafe { Transposer { funcref }.untyped }
}
}
Expand Down

0 comments on commit 81a5277

Please sign in to comment.