Make infer higher ranked equate use bidirectional subtyping in invariant context
This commit is contained in:
parent
384d26fc7e
commit
23ae3dbb31
15 changed files with 153 additions and 47 deletions
|
@ -168,6 +168,7 @@ pub fn check_intrinsic_type(
|
|||
let name_str = intrinsic_name.as_str();
|
||||
|
||||
let bound_vars = tcx.mk_bound_variable_kinds(&[
|
||||
ty::BoundVariableKind::Region(ty::BrAnon),
|
||||
ty::BoundVariableKind::Region(ty::BrAnon),
|
||||
ty::BoundVariableKind::Region(ty::BrEnv),
|
||||
]);
|
||||
|
@ -181,7 +182,7 @@ pub fn check_intrinsic_type(
|
|||
let env_region = ty::Region::new_bound(
|
||||
tcx,
|
||||
ty::INNERMOST,
|
||||
ty::BoundRegion { var: ty::BoundVar::from_u32(1), kind: ty::BrEnv },
|
||||
ty::BoundRegion { var: ty::BoundVar::from_u32(2), kind: ty::BrEnv },
|
||||
);
|
||||
let va_list_ty = tcx.type_of(did).instantiate(tcx, &[region.into()]);
|
||||
(Ty::new_ref(tcx, env_region, ty::TypeAndMut { ty: va_list_ty, mutbl }), va_list_ty)
|
||||
|
@ -493,9 +494,12 @@ pub fn check_intrinsic_type(
|
|||
|
||||
sym::raw_eq => {
|
||||
let br = ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon };
|
||||
let param_ty =
|
||||
let param_ty_lhs =
|
||||
Ty::new_imm_ref(tcx, ty::Region::new_bound(tcx, ty::INNERMOST, br), param(0));
|
||||
(1, 0, vec![param_ty; 2], tcx.types.bool)
|
||||
let br = ty::BoundRegion { var: ty::BoundVar::from_u32(1), kind: ty::BrAnon };
|
||||
let param_ty_rhs =
|
||||
Ty::new_imm_ref(tcx, ty::Region::new_bound(tcx, ty::INNERMOST, br), param(0));
|
||||
(1, 0, vec![param_ty_lhs, param_ty_rhs], tcx.types.bool)
|
||||
}
|
||||
|
||||
sym::black_box => (1, 0, vec![param(0)], param(0)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue