don't lazily evaulate some trivial values for Option::None replacements (clippy::unnecessary_lazy_evaluations)
This commit is contained in:
@@ -480,10 +480,7 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
|
||||
};
|
||||
let base_ty = base_place.ty(self.builder.body, self.builder.tcx).ty;
|
||||
let len: u64 = match base_ty.kind() {
|
||||
ty::Array(_, size) => {
|
||||
let length: u64 = size.eval_usize(self.builder.tcx, self.builder.param_env);
|
||||
length
|
||||
}
|
||||
ty::Array(_, size) => size.eval_usize(self.builder.tcx, self.builder.param_env),
|
||||
_ => bug!("from_end: false slice pattern of non-array type"),
|
||||
};
|
||||
for offset in from..to {
|
||||
|
||||
Reference in New Issue
Block a user