Skip to content

Commit f4080fc

Browse files
committed
Drop an if let that will always succeed
We've already checked that `proj_base == []` in the line above and renaming `place_local` to `local` doesn't gain us anything.
1 parent 5ea1923 commit f4080fc

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

compiler/rustc_mir/src/transform/check_consts/validation.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -729,13 +729,11 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
729729
let base_ty = Place::ty_from(place_local, proj_base, self.body, self.tcx).ty;
730730
if let ty::RawPtr(_) = base_ty.kind() {
731731
if proj_base.is_empty() {
732-
if let (local, []) = (place_local, proj_base) {
733-
let decl = &self.body.local_decls[local];
734-
if let Some(box LocalInfo::StaticRef { def_id, .. }) = decl.local_info {
735-
let span = decl.source_info.span;
736-
self.check_static(def_id, span);
737-
return;
738-
}
732+
let decl = &self.body.local_decls[place_local];
733+
if let Some(box LocalInfo::StaticRef { def_id, .. }) = decl.local_info {
734+
let span = decl.source_info.span;
735+
self.check_static(def_id, span);
736+
return;
739737
}
740738
}
741739
self.check_op(ops::RawPtrDeref);

0 commit comments

Comments
 (0)