Rollup merge of #86028 - LingMan:dupe_empty_check, r=jyn514

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.

``@rustbot`` modify labels +C-cleanup +T-compiler
This commit is contained in:
Yuki Okushi 2021-06-06 19:11:22 +09:00 committed by GitHub
commit 1886123b7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -729,15 +729,13 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
let base_ty = Place::ty_from(place_local, proj_base, self.body, self.tcx).ty;
if let ty::RawPtr(_) = base_ty.kind() {
if proj_base.is_empty() {
if let (local, []) = (place_local, proj_base) {
let decl = &self.body.local_decls[local];
let decl = &self.body.local_decls[place_local];
if let Some(box LocalInfo::StaticRef { def_id, .. }) = decl.local_info {
let span = decl.source_info.span;
self.check_static(def_id, span);
return;
}
}
}
self.check_op(ops::RawPtrDeref);
}