cranelift: Small documentation fixes (#5377)
* `translate_operator` doesn't return a boolean. * `from_base_offset` doesn't panic if offset is smaller than base.
This commit is contained in:
@@ -63,10 +63,6 @@ impl RelSourceLoc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a new `RelSourceLoc` based on the given base and offset.
|
/// Creates a new `RelSourceLoc` based on the given base and offset.
|
||||||
///
|
|
||||||
/// # Panics
|
|
||||||
///
|
|
||||||
/// Panics if the offset is smaller than the base.
|
|
||||||
pub fn from_base_offset(base: SourceLoc, offset: SourceLoc) -> Self {
|
pub fn from_base_offset(base: SourceLoc, offset: SourceLoc) -> Self {
|
||||||
if base.is_default() || offset.is_default() {
|
if base.is_default() || offset.is_default() {
|
||||||
Self::default()
|
Self::default()
|
||||||
|
|||||||
@@ -100,8 +100,7 @@ use wasmparser::{FuncValidator, MemArg, Operator, WasmModuleResources};
|
|||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(clippy::unneeded_field_pattern, clippy::cognitive_complexity)
|
allow(clippy::unneeded_field_pattern, clippy::cognitive_complexity)
|
||||||
)]
|
)]
|
||||||
/// Translates wasm operators into Cranelift IR instructions. Returns `true` if it inserted
|
/// Translates wasm operators into Cranelift IR instructions.
|
||||||
/// a return.
|
|
||||||
pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
|
pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
|
||||||
validator: &mut FuncValidator<impl WasmModuleResources>,
|
validator: &mut FuncValidator<impl WasmModuleResources>,
|
||||||
op: &Operator,
|
op: &Operator,
|
||||||
|
|||||||
Reference in New Issue
Block a user