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
|
@ -174,6 +174,9 @@ impl Parse for Newtype {
|
|||
/// Maximum value the index can take.
|
||||
#vis const MAX: Self = Self::from_u32(#max);
|
||||
|
||||
/// Zero value of the index.
|
||||
#vis const ZERO: Self = Self::from_u32(0);
|
||||
|
||||
/// Creates a new index from a given `usize`.
|
||||
///
|
||||
/// # Panics
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue