Skip to content

Commit

Permalink
Rename from_u32_const -> from_u32
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstatic-morse committed Mar 17, 2020
1 parent 429b16e commit 7f5a284
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/librustc/hir/map/mod.rs
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/mod.rs
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_ast/node_id.rs
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_hir/hir_id.rs
Expand Up @@ -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 };

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_index/vec.rs
Expand Up @@ -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])*]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_span/def_id.rs
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_span/symbol.rs
Expand Up @@ -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.
Expand Down

0 comments on commit 7f5a284

Please sign in to comment.