Rename from_u32_const
-> from_u32
This commit is contained in:
parent
429b16e907
commit
7f5a2841ea
@ -346,7 +346,7 @@ impl<'hir> Map<'hir> {
|
||||
}
|
||||
|
||||
fn get_entry(&self, id: HirId) -> Entry<'hir> {
|
||||
if id.local_id == ItemLocalId::from_u32_const(0) {
|
||||
if id.local_id == ItemLocalId::from_u32(0) {
|
||||
let owner = self.tcx.hir_owner(id.owner_def_id());
|
||||
Entry { parent: owner.parent, node: owner.node }
|
||||
} else {
|
||||
|
@ -1697,7 +1697,7 @@ rustc_index::newtype_index! {
|
||||
}
|
||||
|
||||
impl UniverseIndex {
|
||||
pub const ROOT: UniverseIndex = UniverseIndex::from_u32_const(0);
|
||||
pub const ROOT: UniverseIndex = UniverseIndex::from_u32(0);
|
||||
|
||||
/// Returns the "next" universe index in order -- this new index
|
||||
/// is considered to extend all previous universes. This
|
||||
|
@ -12,7 +12,7 @@ rustc_index::newtype_index! {
|
||||
rustc_data_structures::define_id_collections!(NodeMap, NodeSet, NodeId);
|
||||
|
||||
/// `NodeId` used to represent the root of the crate.
|
||||
pub const CRATE_NODE_ID: NodeId = NodeId::from_u32_const(0);
|
||||
pub const CRATE_NODE_ID: NodeId = NodeId::from_u32(0);
|
||||
|
||||
/// When parsing and doing expansions, we initially give all AST nodes this AST
|
||||
/// node value. Then later, in the renumber pass, we renumber them to have
|
||||
|
@ -71,7 +71,7 @@ rustc_data_structures::impl_stable_hash_via_hash!(ItemLocalId);
|
||||
|
||||
/// The `HirId` corresponding to `CRATE_NODE_ID` and `CRATE_DEF_INDEX`.
|
||||
pub const CRATE_HIR_ID: HirId =
|
||||
HirId { owner: CRATE_DEF_INDEX, local_id: ItemLocalId::from_u32_const(0) };
|
||||
HirId { owner: CRATE_DEF_INDEX, local_id: ItemLocalId::from_u32(0) };
|
||||
|
||||
pub const DUMMY_HIR_ID: HirId = HirId { owner: CRATE_DEF_INDEX, local_id: DUMMY_ITEM_LOCAL_ID };
|
||||
|
||||
|
@ -482,7 +482,7 @@ macro_rules! newtype_index {
|
||||
const $name:ident = $constant:expr,
|
||||
$($tokens:tt)*) => (
|
||||
$(#[doc = $doc])*
|
||||
$v const $name: $type = $type::from_u32_const($constant);
|
||||
$v const $name: $type = $type::from_u32($constant);
|
||||
$crate::newtype_index!(
|
||||
@derives [$($derives,)*]
|
||||
@attrs [$(#[$attrs])*]
|
||||
|
@ -25,7 +25,7 @@ pub enum CrateNum {
|
||||
|
||||
/// Item definitions in the currently-compiled crate would have the `CrateNum`
|
||||
/// `LOCAL_CRATE` in their `DefId`.
|
||||
pub const LOCAL_CRATE: CrateNum = CrateNum::Index(CrateId::from_u32_const(0));
|
||||
pub const LOCAL_CRATE: CrateNum = CrateNum::Index(CrateId::from_u32(0));
|
||||
|
||||
impl Idx for CrateNum {
|
||||
#[inline]
|
||||
|
@ -997,7 +997,7 @@ rustc_index::newtype_index! {
|
||||
|
||||
impl Symbol {
|
||||
const fn new(n: u32) -> Self {
|
||||
Symbol(SymbolIndex::from_u32_const(n))
|
||||
Symbol(SymbolIndex::from_u32(n))
|
||||
}
|
||||
|
||||
/// Maps a string to its interned representation.
|
||||
|
Loading…
x
Reference in New Issue
Block a user