Rollup merge of #123419 - petrochenkov:zeroindex, r=compiler-errors
rustc_index: Add a `ZERO` constant to index types It is commonly used.
This commit is contained in:
@@ -183,7 +183,7 @@ pub fn check_intrinsic_type(
|
||||
let region = ty::Region::new_bound(
|
||||
tcx,
|
||||
ty::INNERMOST,
|
||||
ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon },
|
||||
ty::BoundRegion { var: ty::BoundVar::ZERO, kind: ty::BrAnon },
|
||||
);
|
||||
let env_region = ty::Region::new_bound(
|
||||
tcx,
|
||||
@@ -495,7 +495,7 @@ pub fn check_intrinsic_type(
|
||||
);
|
||||
let discriminant_def_id = assoc_items[0];
|
||||
|
||||
let br = ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon };
|
||||
let br = ty::BoundRegion { var: ty::BoundVar::ZERO, kind: ty::BrAnon };
|
||||
(
|
||||
1,
|
||||
0,
|
||||
@@ -555,7 +555,7 @@ pub fn check_intrinsic_type(
|
||||
}
|
||||
|
||||
sym::raw_eq => {
|
||||
let br = ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon };
|
||||
let br = ty::BoundRegion { var: ty::BoundVar::ZERO, kind: ty::BrAnon };
|
||||
let param_ty_lhs =
|
||||
Ty::new_imm_ref(tcx, ty::Region::new_bound(tcx, ty::INNERMOST, br), param(0));
|
||||
let br = ty::BoundRegion { var: ty::BoundVar::from_u32(1), kind: ty::BrAnon };
|
||||
|
||||
Reference in New Issue
Block a user