1
Fork 0

Rename from_u32_const -> from_u32

This commit is contained in:
Dylan MacKenzie 2020-03-10 13:44:53 -07:00
parent 429b16e907
commit 7f5a2841ea
7 changed files with 7 additions and 7 deletions

View file

@ -346,7 +346,7 @@ impl<'hir> Map<'hir> {
} }
fn get_entry(&self, id: HirId) -> Entry<'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()); let owner = self.tcx.hir_owner(id.owner_def_id());
Entry { parent: owner.parent, node: owner.node } Entry { parent: owner.parent, node: owner.node }
} else { } else {

View file

@ -1697,7 +1697,7 @@ rustc_index::newtype_index! {
} }
impl UniverseIndex { 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 /// Returns the "next" universe index in order -- this new index
/// is considered to extend all previous universes. This /// is considered to extend all previous universes. This

View file

@ -12,7 +12,7 @@ rustc_index::newtype_index! {
rustc_data_structures::define_id_collections!(NodeMap, NodeSet, NodeId); rustc_data_structures::define_id_collections!(NodeMap, NodeSet, NodeId);
/// `NodeId` used to represent the root of the crate. /// `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 /// 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 /// node value. Then later, in the renumber pass, we renumber them to have

View file

@ -71,7 +71,7 @@ rustc_data_structures::impl_stable_hash_via_hash!(ItemLocalId);
/// The `HirId` corresponding to `CRATE_NODE_ID` and `CRATE_DEF_INDEX`. /// The `HirId` corresponding to `CRATE_NODE_ID` and `CRATE_DEF_INDEX`.
pub const CRATE_HIR_ID: HirId = 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 }; pub const DUMMY_HIR_ID: HirId = HirId { owner: CRATE_DEF_INDEX, local_id: DUMMY_ITEM_LOCAL_ID };

View file

@ -482,7 +482,7 @@ macro_rules! newtype_index {
const $name:ident = $constant:expr, const $name:ident = $constant:expr,
$($tokens:tt)*) => ( $($tokens:tt)*) => (
$(#[doc = $doc])* $(#[doc = $doc])*
$v const $name: $type = $type::from_u32_const($constant); $v const $name: $type = $type::from_u32($constant);
$crate::newtype_index!( $crate::newtype_index!(
@derives [$($derives,)*] @derives [$($derives,)*]
@attrs [$(#[$attrs])*] @attrs [$(#[$attrs])*]

View file

@ -25,7 +25,7 @@ pub enum CrateNum {
/// Item definitions in the currently-compiled crate would have the `CrateNum` /// Item definitions in the currently-compiled crate would have the `CrateNum`
/// `LOCAL_CRATE` in their `DefId`. /// `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 { impl Idx for CrateNum {
#[inline] #[inline]

View file

@ -997,7 +997,7 @@ rustc_index::newtype_index! {
impl Symbol { impl Symbol {
const fn new(n: u32) -> Self { const fn new(n: u32) -> Self {
Symbol(SymbolIndex::from_u32_const(n)) Symbol(SymbolIndex::from_u32(n))
} }
/// Maps a string to its interned representation. /// Maps a string to its interned representation.