rustc_index: Add a ZERO
constant to index types
It is commonly used.
This commit is contained in:
parent
ceab6128fa
commit
b40ea03f8a
42 changed files with 80 additions and 90 deletions
|
@ -215,7 +215,7 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
|
|||
|
||||
fn parse_local_decls(&mut self, mut stmts: impl Iterator<Item = StmtId>) -> PResult<()> {
|
||||
let (ret_var, ..) = self.parse_let_statement(stmts.next().unwrap())?;
|
||||
self.local_map.insert(ret_var, Local::from_u32(0));
|
||||
self.local_map.insert(ret_var, Local::ZERO);
|
||||
|
||||
for stmt in stmts {
|
||||
let (var, ty, span) = self.parse_let_statement(stmt)?;
|
||||
|
|
|
@ -573,7 +573,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||
result_value,
|
||||
Rvalue::CheckedBinaryOp(op, Box::new((lhs.to_copy(), rhs.to_copy()))),
|
||||
);
|
||||
let val_fld = FieldIdx::new(0);
|
||||
let val_fld = FieldIdx::ZERO;
|
||||
let of_fld = FieldIdx::new(1);
|
||||
|
||||
let tcx = self.tcx;
|
||||
|
|
|
@ -190,7 +190,7 @@ rustc_index::newtype_index! {
|
|||
struct DropIdx {}
|
||||
}
|
||||
|
||||
const ROOT_NODE: DropIdx = DropIdx::from_u32(0);
|
||||
const ROOT_NODE: DropIdx = DropIdx::ZERO;
|
||||
|
||||
/// A tree of drops that we have deferred lowering. It's used for:
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue