mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
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:
commit
1886123b7d
@ -729,13 +729,11 @@ 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];
|
||||
if let Some(box LocalInfo::StaticRef { def_id, .. }) = decl.local_info {
|
||||
let span = decl.source_info.span;
|
||||
self.check_static(def_id, span);
|
||||
return;
|
||||
}
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user