diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-06-28 07:17:43 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-07-15 15:56:17 +0000 |
| commit | 6b33d5bfa94f0005c2ae7136f4cda14a396e42bc (patch) | |
| tree | 120dcddd97c6d211fce3b95891ce987d6237d26f /compiler/rustc_borrowck | |
| parent | 728c7e8bda215dc0ef055a817964f199427512e0 (diff) | |
| download | rust-6b33d5bfa94f0005c2ae7136f4cda14a396e42bc.tar.gz rust-6b33d5bfa94f0005c2ae7136f4cda14a396e42bc.zip | |
Make destructuring a defining use
Diffstat (limited to 'compiler/rustc_borrowck')
| -rw-r--r-- | compiler/rustc_borrowck/src/type_check/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index e139a73efc5..8e763a02af3 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -793,6 +793,14 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> { ProjectionElem::OpaqueCast(ty) => { let ty = self.sanitize_type(place, ty); let ty = self.cx.normalize(ty, location); + self.cx + .eq_types( + base.ty, + ty, + location.to_locations(), + ConstraintCategory::TypeAnnotation, + ) + .unwrap(); PlaceTy::from_ty(ty) } } |
