Skip to content

Commit 7f5a284

Browse files
Rename from_u32_const -> from_u32
1 parent 429b16e commit 7f5a284

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

src/librustc/hir/map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl<'hir> Map<'hir> {
346346
}
347347

348348
fn get_entry(&self, id: HirId) -> Entry<'hir> {
349-
if id.local_id == ItemLocalId::from_u32_const(0) {
349+
if id.local_id == ItemLocalId::from_u32(0) {
350350
let owner = self.tcx.hir_owner(id.owner_def_id());
351351
Entry { parent: owner.parent, node: owner.node }
352352
} else {

src/librustc/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1697,7 +1697,7 @@ rustc_index::newtype_index! {
16971697
}
16981698

16991699
impl UniverseIndex {
1700-
pub const ROOT: UniverseIndex = UniverseIndex::from_u32_const(0);
1700+
pub const ROOT: UniverseIndex = UniverseIndex::from_u32(0);
17011701

17021702
/// Returns the "next" universe index in order -- this new index
17031703
/// is considered to extend all previous universes. This

src/librustc_ast/node_id.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ rustc_index::newtype_index! {
1212
rustc_data_structures::define_id_collections!(NodeMap, NodeSet, NodeId);
1313

1414
/// `NodeId` used to represent the root of the crate.
15-
pub const CRATE_NODE_ID: NodeId = NodeId::from_u32_const(0);
15+
pub const CRATE_NODE_ID: NodeId = NodeId::from_u32(0);
1616

1717
/// When parsing and doing expansions, we initially give all AST nodes this AST
1818
/// node value. Then later, in the renumber pass, we renumber them to have

src/librustc_hir/hir_id.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ rustc_data_structures::impl_stable_hash_via_hash!(ItemLocalId);
7171

7272
/// The `HirId` corresponding to `CRATE_NODE_ID` and `CRATE_DEF_INDEX`.
7373
pub const CRATE_HIR_ID: HirId =
74-
HirId { owner: CRATE_DEF_INDEX, local_id: ItemLocalId::from_u32_const(0) };
74+
HirId { owner: CRATE_DEF_INDEX, local_id: ItemLocalId::from_u32(0) };
7575

7676
pub const DUMMY_HIR_ID: HirId = HirId { owner: CRATE_DEF_INDEX, local_id: DUMMY_ITEM_LOCAL_ID };
7777

src/librustc_index/vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ macro_rules! newtype_index {
482482
const $name:ident = $constant:expr,
483483
$($tokens:tt)*) => (
484484
$(#[doc = $doc])*
485-
$v const $name: $type = $type::from_u32_const($constant);
485+
$v const $name: $type = $type::from_u32($constant);
486486
$crate::newtype_index!(
487487
@derives [$($derives,)*]
488488
@attrs [$(#[$attrs])*]

src/librustc_span/def_id.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub enum CrateNum {
2525

2626
/// Item definitions in the currently-compiled crate would have the `CrateNum`
2727
/// `LOCAL_CRATE` in their `DefId`.
28-
pub const LOCAL_CRATE: CrateNum = CrateNum::Index(CrateId::from_u32_const(0));
28+
pub const LOCAL_CRATE: CrateNum = CrateNum::Index(CrateId::from_u32(0));
2929

3030
impl Idx for CrateNum {
3131
#[inline]

src/librustc_span/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ rustc_index::newtype_index! {
997997

998998
impl Symbol {
999999
const fn new(n: u32) -> Self {
1000-
Symbol(SymbolIndex::from_u32_const(n))
1000+
Symbol(SymbolIndex::from_u32(n))
10011001
}
10021002

10031003
/// Maps a string to its interned representation.

0 commit comments

Comments
 (0)