Make destructuring a defining use
This commit is contained in:
parent
728c7e8bda
commit
6b33d5bfa9
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
#![feature(type_alias_impl_trait)]
|
||||
// check-pass
|
||||
|
||||
type T = impl Copy;
|
||||
|
||||
fn foo(foo: T) {
|
||||
let (mut x, mut y) = foo;
|
||||
x = 42;
|
||||
y = "foo";
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
x
Reference in New Issue
Block a user