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:
committed by
Dan Gohman
parent
586a8835e9
commit
b288c6001a
@@ -127,7 +127,7 @@ fn maybe_resolve_aliases(values: &PrimaryMap<Value, ValueData>, value: Value) ->
|
||||
let mut v = value;
|
||||
|
||||
// Note that values may be empty here.
|
||||
for _ in 0..1 + values.len() {
|
||||
for _ in 0..values.len() + 1 {
|
||||
if let ValueData::Alias { original, .. } = values[v] {
|
||||
v = original;
|
||||
} else {
|
||||
@@ -174,8 +174,7 @@ impl<'a> Iterator for Values<'a> {
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
self.inner
|
||||
.by_ref()
|
||||
.filter(|kv| valid_valuedata(kv.1))
|
||||
.next()
|
||||
.find(|kv| valid_valuedata(kv.1))
|
||||
.map(|kv| kv.0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,19 +178,14 @@ impl Function {
|
||||
///
|
||||
/// This function can only be used after the code layout has been computed by the
|
||||
/// `binemit::relax_branches()` function.
|
||||
pub fn inst_offsets<'a>(
|
||||
&'a self,
|
||||
func: &'a Function,
|
||||
ebb: Ebb,
|
||||
encinfo: &EncInfo,
|
||||
) -> InstOffsetIter<'a> {
|
||||
pub fn inst_offsets<'a>(&'a self, ebb: Ebb, encinfo: &EncInfo) -> InstOffsetIter<'a> {
|
||||
assert!(
|
||||
!self.offsets.is_empty(),
|
||||
"Code layout must be computed first"
|
||||
);
|
||||
InstOffsetIter {
|
||||
encinfo: encinfo.clone(),
|
||||
func,
|
||||
func: self,
|
||||
divert: RegDiversions::new(),
|
||||
encodings: &self.encodings,
|
||||
offset: self.offsets[ebb],
|
||||
|
||||
Reference in New Issue
Block a user