Fix all clippy warnings (#564)

* Fix all clippy warnings

* Revert usage of inclusive ranges

* Remove redundant function argument

* Revert use of unavailable pointer methods

* Introduce ContiguousCaseRange
This commit is contained in:
Boris-Chengbiao Zhou
2018-10-23 06:52:35 +02:00
committed by Dan Gohman
parent 586a8835e9
commit b288c6001a
17 changed files with 100 additions and 98 deletions

View File

@@ -234,7 +234,8 @@ pub fn verify_function<'a, FOI: Into<FlagsOrIsa<'a>>>(
let verifier = Verifier::new(func, fisa.into());
let result = verifier.run(&mut errors);
if errors.is_empty() {
Ok(result.unwrap())
result.unwrap();
Ok(())
} else {
Err(errors)
}
@@ -392,30 +393,22 @@ impl<'a> Verifier<'a> {
);
}
match heap_data.style {
ir::HeapStyle::Dynamic { bound_gv, .. } => {
if !self.func.global_values.is_valid(bound_gv) {
return nonfatal!(
errors,
heap,
"invalid bound global value {}",
bound_gv
);
}
let index_type = heap_data.index_type;
let bound_type = self.func.global_values[bound_gv].global_type(isa);
if index_type != bound_type {
report!(
errors,
heap,
"heap index type {} differs from the type of its bound, {}",
index_type,
bound_type
);
}
if let ir::HeapStyle::Dynamic { bound_gv, .. } = heap_data.style {
if !self.func.global_values.is_valid(bound_gv) {
return nonfatal!(errors, heap, "invalid bound global value {}", bound_gv);
}
let index_type = heap_data.index_type;
let bound_type = self.func.global_values[bound_gv].global_type(isa);
if index_type != bound_type {
report!(
errors,
heap,
"heap index type {} differs from the type of its bound, {}",
index_type,
bound_type
);
}
_ => {}
}
}
}