Skip to content

Commit adf4481

Browse files
committed
fix relation with invariance
1 parent c7f0d95 commit adf4481

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

compiler/rustc_type_ir/src/relate.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,13 @@ pub fn structurally_relate_tys<I: Interner, R: TypeRelation<I>>(
411411
}
412412

413413
(ty::Field(lcontainer, lpath), ty::Field(rcontainer, rpath)) => {
414-
let t = relation.relate(lcontainer, rcontainer)?;
414+
let t = relation.relate_with_variance(
415+
ty::Invariant,
416+
VarianceDiagInfo::default(),
417+
lcontainer,
418+
rcontainer,
419+
)?;
420+
415421
if lpath == rpath {
416422
Ok(Ty::new_field_type(cx, t, lpath))
417423
} else {

0 commit comments

Comments
 (0)