diff options
| author | LingMan <LingMan@users.noreply.github.com> | 2021-06-05 18:12:47 +0200 |
|---|---|---|
| committer | LingMan <LingMan@users.noreply.github.com> | 2021-06-05 18:12:47 +0200 |
| commit | f4080fca627d36ffda16410cb957348119ae64ea (patch) | |
| tree | f5bb2c534de332ed3217aa0b4213f2fcb9e7b371 | |
| parent | 5ea19239d9d6f49fdd76513a36386d7e83708e3f (diff) | |
| download | rust-f4080fca627d36ffda16410cb957348119ae64ea.tar.gz rust-f4080fca627d36ffda16410cb957348119ae64ea.zip | |
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.
| -rw-r--r-- | compiler/rustc_mir/src/transform/check_consts/validation.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/rustc_mir/src/transform/check_consts/validation.rs b/compiler/rustc_mir/src/transform/check_consts/validation.rs index ac3420ad339..4fbd27c89d9 100644 --- a/compiler/rustc_mir/src/transform/check_consts/validation.rs +++ b/compiler/rustc_mir/src/transform/check_consts/validation.rs @@ -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); |
